package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.security.annotation.InnerAuth;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.AllInterfaceName;
import com.ruoyi.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 gyt
 * @date 2025-08-25
 */
@RestController
@RequestMapping("/interfaceName")
public class AllInterfaceNameController extends BaseController
{
    @Autowired
    private IAllInterfaceNameService allInterfaceNameService;

    /**
     * 查询所有接口名称列表
     */
    @RequiresPermissions("system:interfaceName:list")
    @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);
    }

}
