package com.tongran.system.controller;

import com.tongran.common.core.domain.R;
import com.tongran.common.core.web.controller.BaseController;
import com.tongran.common.security.annotation.InnerAuth;
import com.tongran.system.domain.AllInterfaceName;
import com.tongran.system.service.IAllInterfaceNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 所有接口名称Controller
 * 
 * @author tongran
 * @date 2025-08-25
 */
@RestController
@RequestMapping("/interfaceName")
public class AllInterfaceNameController extends BaseController
{
    @Autowired
    private IAllInterfaceNameService allInterfaceNameService;

    /**
     * 查询所有接口名称列表
     */
    @PostMapping("/getAllNames")
    public List<AllInterfaceName> list(@RequestBody AllInterfaceName allInterfaceName)
    {
        List<AllInterfaceName> list = allInterfaceNameService.selectAllInterfaceNameList(allInterfaceName);
        return list;
    }
    /**
     * 查询所有接口名称列表
     */
    @InnerAuth
    @PostMapping("/getMsgByClientId")
    public R<AllInterfaceName> getMsgByClientId(@RequestBody AllInterfaceName allInterfaceName)
    {
        List<AllInterfaceName> list = allInterfaceNameService.selectAllInterfaceNameList(allInterfaceName);
        AllInterfaceName allInterfaceName1 = list.isEmpty()?new AllInterfaceName():list.get(0);
        return R.ok(allInterfaceName1);
    }

}
