mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
[feat] 通过用户ID查询用户信息
This commit is contained in:
@@ -22,6 +22,15 @@ import com.ruoyi.system.api.model.LoginUser;
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||
public interface RemoteUserService
|
||||
{
|
||||
/**
|
||||
* 通过用户ID查询用户信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping({"/user/", "/user/{userId}"})
|
||||
public R<LoginUser> getInfo(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
|
||||
@@ -25,6 +25,12 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteUserService()
|
||||
{
|
||||
@Override
|
||||
public R<LoginUser> getInfo(Long userId, String source)
|
||||
{
|
||||
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<LoginUser> getUserInfo(String username, String source)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user