Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-usercenter-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d1366280
authored
Jun 19, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加通过用户ID获取所在租户信息
1 parent
35271c2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
21 deletions
src/main/java/cn/com/glsx/usercenter/api/feign/ApiUserService.java
src/main/java/cn/com/glsx/usercenter/api/feign/UserService.java
src/main/java/cn/com/glsx/usercenter/api/feign/fallback/ApiUserServiceFallbackImpl.java
src/main/java/cn/com/glsx/usercenter/api/feign/fallback/UserServiceFallbackImpl.java
src/main/java/cn/com/glsx/usercenter/api/feign/ApiUserService.java
View file @
d136628
package
cn
.
com
.
glsx
.
usercenter
.
api
.
feign
;
import
cn.com.glsx.usercenter.api.dto.request.SimpleAddUser
;
import
cn.com.glsx.usercenter.api.dto.response.TenantDto
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
...
...
@@ -51,4 +52,13 @@ public interface ApiUserService {
*/
@PostMapping
(
value
=
"/simple/add"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
User
>
addSimpleUser
(
@RequestBody
SimpleAddUser
simpleAddUser
);
/**
* 根据用户ID获取该用户所在租户
*
* @param userId 用户Id
* @return 租户数据
*/
@GetMapping
(
value
=
"/getTenantByUserId"
)
R
<
TenantDto
>
getTenantByUserId
(
@RequestParam
(
"userId"
)
Long
userId
);
}
src/main/java/cn/com/glsx/usercenter/api/feign/UserService.java
View file @
d136628
...
...
@@ -95,13 +95,4 @@ public interface UserService {
*/
@GetMapping
(
value
=
"/findAllByOrg"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findAllByOrg
(
FindUserRequest
request
);
/**
* 根据用户ID获取该用户所在租户
*
* @param userId 用户Id
* @return 租户数据
*/
@GetMapping
(
value
=
"/getTenantByUserId"
)
R
<
TenantDto
>
getTenantByUserId
(
@RequestParam
(
"userId"
)
Long
userId
);
}
src/main/java/cn/com/glsx/usercenter/api/feign/fallback/ApiUserServiceFallbackImpl.java
View file @
d136628
package
cn
.
com
.
glsx
.
usercenter
.
api
.
feign
.
fallback
;
import
cn.com.glsx.usercenter.api.dto.request.SimpleAddUser
;
import
cn.com.glsx.usercenter.api.dto.response.TenantDto
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.feign.ApiUserService
;
import
com.glsx.plat.core.web.R
;
...
...
@@ -35,4 +36,15 @@ public class ApiUserServiceFallbackImpl implements ApiUserService {
return
R
.
ok
();
}
/**
* 根据用户ID获取该用户所在租户
*
* @param userId 用户Id
* @return 租户数据
*/
@Override
public
R
<
TenantDto
>
getTenantByUserId
(
Long
userId
)
{
log
.
warn
(
"熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
();
}
}
src/main/java/cn/com/glsx/usercenter/api/feign/fallback/UserServiceFallbackImpl.java
View file @
d136628
...
...
@@ -67,16 +67,4 @@ public class UserServiceFallbackImpl implements UserService {
log
.
warn
(
"熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
();
}
/**
* 根据用户ID获取该用户所在租户
*
* @param userId 用户Id
* @return 租户数据
*/
@Override
public
R
<
TenantDto
>
getTenantByUserId
(
Long
userId
)
{
log
.
warn
(
"熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
();
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment