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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yuchen.saas.manage.system.api.entity.Role;
import com.yuchen.saas.manage.system.api.vo.RoleParkVO;
import com.yuchen.saas.manage.system.api.vo.RoleVO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.Condition;
import org.nest.springwrap.core.secure.ContextUser;
import org.nest.springwrap.core.tool.api.R;
import org.nest.springwrap.core.tool.constant.NestConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Map;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/25 10:06
 * @Description: 角色feign-api
 * @Version: 1.0
 */
@FeignClient(
        value = AppNameConstant.SAAS_SYSTEM,
        fallbackFactory = RoleFeignFallback.class
)
public interface RoleFeignServer {

    /**
     * 角色详情
     *
     * @param role
     * @return
     */
    @GetMapping("/role/detail")
    R<RoleVO> detail(@SpringQueryMap Role role);


    @GetMapping("/role/list")
    R list(@RequestParam("role") Map<String, Object> role, ContextUser contextUser);

    @GetMapping("/role/listByAlias")
    R<List<Long>> listByAlias(@RequestParam("roleAlias") List<String> roleAlias,@RequestParam("tenantId") Long tenantId);

    @GetMapping("/role/getRoleParksByRoleId")
    R<List<RoleParkVO>> getRoleParksByRoleId(@RequestParam("id")String id);
}