package com.yida.data.system.feign;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import com.yida.data.common.core.entity.system.Role;

import com.yida.data.system.fallback.RemoteRoleServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "roleServiceClient",
        fallbackFactory = RemoteRoleServiceFallback.class)
public interface RemoteRoleService {

    @GetMapping("/role/listMenuByRole")
    ResultBean<List> listMenuByRole(@RequestParam("roleIds") Long[] roleIds);

    @GetMapping("/role/listMenuByRoleName")
    ResultBean<List> listMenuByRoleName(@RequestParam("roleNames") String[] roleIds);

    @GetMapping("/role/getRoleByName")
    ResultBean<Role> getRoleByName(@RequestParam("roleName") String roleName);


    @GetMapping("/in/role/getRoleByName")
    ResultBean<Role> getRoleByNameNoPermission(@RequestParam("roleName") String roleName);
}
