package com.yuchen.saas.manage.system.api.feign;


import com.yuchen.saas.manage.system.api.entity.NestBusiness;
import com.yuchen.saas.manage.system.api.param.CommonListIdParam;
import com.yuchen.saas.manage.system.api.vo.NestBusinessVO;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/25 13:37
 * @Description: TODO
 * @Version: 1.0
 */
@FeignClient(
        value = AppNameConstant.SAAS_SYSTEM,
        fallbackFactory = NestBusinessFallback.class
)
public interface NestBusinessFeignServer {
    @GetMapping("/nestBusiness/openList")
    @ApiOperation(value = "查询已开启业务服务列表", notes = "查询已开启业务服务列表")
    R<List<NestBusinessVO>> openList();

    @PostMapping("/nestBusiness/getListByIds")
    @ApiOperation(value = "根据主键集合获取", notes = "根据主键集合获取")
    R<List<NestBusiness>> getListByIds(@RequestBody CommonListIdParam commonListIdParam);

    @GetMapping("/nestBusiness/getBusinessByMenuId")
    @ApiOperation(value = "根据菜单id获取对应业务")
    R<NestBusiness> getBusinessByMenuId(@RequestParam Long menuId) ;

    @GetMapping("/nestBusiness/getDetail")
    @ApiOperation(value = "业务服务 详情", notes = "业务服务 详情")
    R<NestBusiness> getDetail(@RequestParam Long id);

}
