New file |
| | |
| | | package com.ruoyi.system.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.factory.SysUserRoleFallbackFactory; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/9/4 9:49 |
| | | */ |
| | | @FeignClient(contextId = "SysUserRoleClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysUserRoleFallbackFactory.class) |
| | | public interface SysUserRoleClient { |
| | | |
| | | |
| | | /** |
| | | * 根据用户id获取角色 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/userRole/getRoleByUserId") |
| | | R<List<SysUserRoleVo>> getRoleByUserId(@RequestParam("userId") Long userId); |
| | | } |