Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-api-system
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-api-system
Commits
40c03e7e
提交
40c03e7e
authored
6月 16, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
差异文件
同步各分支代码,更新至master commit
上级
da329549
b9bb3db2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
9 行删除
+13
-9
RemoteUserService.java
src/main/java/com/sfa/system/api/RemoteUserService.java
+6
-8
RemoteUserFallbackFactory.java
...com/sfa/system/api/factory/RemoteUserFallbackFactory.java
+7
-1
没有找到文件。
src/main/java/com/sfa/system/api/RemoteUserService.java
浏览文件 @
40c03e7e
package
com
.
sfa
.
system
.
api
;
package
com
.
sfa
.
system
.
api
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
com.sfa.common.core.constant.SecurityConstants
;
import
com.sfa.common.core.constant.SecurityConstants
;
import
com.sfa.common.core.constant.ServiceNameConstants
;
import
com.sfa.common.core.constant.ServiceNameConstants
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.system.api.domain.SysUser
;
import
com.sfa.system.api.domain.SysUser
;
import
com.sfa.system.api.factory.RemoteUserFallbackFactory
;
import
com.sfa.system.api.factory.RemoteUserFallbackFactory
;
import
com.sfa.system.api.model.LoginUser
;
import
com.sfa.system.api.model.LoginUser
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
* 用户服务
* 用户服务
*
*
* @author ruoyi
* @author ruoyi
*/
*/
@FeignClient
(
contextId
=
"remoteUserService"
,
value
=
ServiceNameConstants
.
SYSTEM_SERVICE
,
fallbackFactory
=
RemoteUserFallbackFactory
.
class
)
@FeignClient
(
contextId
=
"remoteUserService"
,
value
=
ServiceNameConstants
.
SYSTEM_SERVICE
,
fallbackFactory
=
RemoteUserFallbackFactory
.
class
)
...
@@ -32,6 +27,9 @@ public interface RemoteUserService
...
@@ -32,6 +27,9 @@ public interface RemoteUserService
@GetMapping
(
"/system/user/info/{username}"
)
@GetMapping
(
"/system/user/info/{username}"
)
public
R
<
LoginUser
>
getUserInfo
(
@PathVariable
(
"username"
)
String
username
,
@RequestHeader
(
SecurityConstants
.
FROM_SOURCE
)
String
source
);
public
R
<
LoginUser
>
getUserInfo
(
@PathVariable
(
"username"
)
String
username
,
@RequestHeader
(
SecurityConstants
.
FROM_SOURCE
)
String
source
);
@GetMapping
(
"/system/user/userInfoById"
)
public
R
<
SysUser
>
getUserInfoById
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestHeader
(
SecurityConstants
.
FROM_SOURCE
)
String
source
);
/**
/**
* 注册用户信息
* 注册用户信息
*
*
...
...
src/main/java/com/sfa/system/api/factory/RemoteUserFallbackFactory.java
浏览文件 @
40c03e7e
...
@@ -11,7 +11,7 @@ import com.sfa.system.api.model.LoginUser;
...
@@ -11,7 +11,7 @@ import com.sfa.system.api.model.LoginUser;
/**
/**
* 用户服务降级处理
* 用户服务降级处理
*
*
* @author ruoyi
* @author ruoyi
*/
*/
@Component
@Component
...
@@ -31,6 +31,12 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
...
@@ -31,6 +31,12 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
return
R
.
fail
(
"获取用户失败:"
+
throwable
.
getMessage
());
return
R
.
fail
(
"获取用户失败:"
+
throwable
.
getMessage
());
}
}
@Override
public
R
<
SysUser
>
getUserInfoById
(
Long
userId
,
String
source
)
{
return
R
.
fail
(
"获取用户失败:"
+
throwable
.
getMessage
());
}
@Override
@Override
public
R
<
Boolean
>
registerUserInfo
(
SysUser
sysUser
,
String
source
)
public
R
<
Boolean
>
registerUserInfo
(
SysUser
sysUser
,
String
source
)
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论