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 137b35a2
authored
Jun 07, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户组织feign开放接口
1 parent
f678472c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
src/main/java/cn/com/glsx/usercenter/api/feign/ApiUserService.java
src/main/java/cn/com/glsx/usercenter/api/feign/OrganizationService.java
src/main/java/cn/com/glsx/usercenter/api/feign/UserService.java
src/main/java/cn/com/glsx/usercenter/api/feign/ApiUserService.java
View file @
137b35a
...
@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
...
@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
import
cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory
;
import
cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -18,10 +19,10 @@ import java.util.List;
...
@@ -18,10 +19,10 @@ import java.util.List;
)
)
public
interface
ApiUserService
{
public
interface
ApiUserService
{
@GetMapping
(
value
=
"/findByAccount"
)
@GetMapping
(
value
=
"/findByAccount"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findByAccount
(
@RequestParam
(
"account"
)
String
account
);
R
<
List
<
User
>>
findByAccount
(
@RequestParam
(
"account"
)
String
account
);
@GetMapping
(
value
=
"/findByUsername"
)
@GetMapping
(
value
=
"/findByUsername"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findByUsername
(
@RequestParam
(
"username"
)
String
username
);
R
<
List
<
User
>>
findByUsername
(
@RequestParam
(
"username"
)
String
username
);
}
}
src/main/java/cn/com/glsx/usercenter/api/feign/OrganizationService.java
View file @
137b35a
...
@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
...
@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
import
cn.com.glsx.usercenter.api.feign.factory.OrganizationServiceFallbackFactory
;
import
cn.com.glsx.usercenter.api.feign.factory.OrganizationServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -25,18 +26,16 @@ public interface OrganizationService {
...
@@ -25,18 +26,16 @@ public interface OrganizationService {
* @param userId
* @param userId
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getTenantPathsByUserId"
)
@GetMapping
(
value
=
"/getTenantPathsByUserId"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getTenantPathsByUserId
(
@RequestParam
(
"userId"
)
Long
userId
);
R
<
List
<
Organization
>>
getTenantPathsByUserId
(
@RequestParam
(
"userId"
)
Long
userId
);
/**
/**
* 根据userIds获取租户机构
* 根据userIds获取租户机构
*
*
* @param userIds
* @param userIds
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getTenantByUserIds"
)
@GetMapping
(
value
=
"/getTenantByUserIds"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getTenantByUserIds
(
@RequestParam
(
"userIds"
)
List
<
Long
>
userIds
);
R
<
List
<
Organization
>>
getTenantByUserIds
(
@RequestParam
(
"userIds"
)
List
<
Long
>
userIds
);
...
@@ -45,7 +44,7 @@ public interface OrganizationService {
...
@@ -45,7 +44,7 @@ public interface OrganizationService {
*
*
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getRootOrgs"
)
@GetMapping
(
value
=
"/getRootOrgs"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getRootOrganizations
();
R
<
List
<
Organization
>>
getRootOrganizations
();
/**
/**
...
@@ -54,7 +53,7 @@ public interface OrganizationService {
...
@@ -54,7 +53,7 @@ public interface OrganizationService {
* @param orgId
* @param orgId
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getSubOrgsBySuperiorId"
)
@GetMapping
(
value
=
"/getSubOrgsBySuperiorId"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getSubOrganizations
(
@RequestParam
(
"orgId"
)
Long
orgId
);
R
<
List
<
Organization
>>
getSubOrganizations
(
@RequestParam
(
"orgId"
)
Long
orgId
);
/**
/**
...
@@ -63,7 +62,7 @@ public interface OrganizationService {
...
@@ -63,7 +62,7 @@ public interface OrganizationService {
* @param userIds
* @param userIds
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getOrgsByUserIds"
)
@GetMapping
(
value
=
"/getOrgsByUserIds"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getOrgsByUserIds
(
@RequestParam
(
"userIds"
)
Collection
<
Long
>
userIds
);
R
<
List
<
Organization
>>
getOrgsByUserIds
(
@RequestParam
(
"userIds"
)
Collection
<
Long
>
userIds
);
/**
/**
...
@@ -72,7 +71,7 @@ public interface OrganizationService {
...
@@ -72,7 +71,7 @@ public interface OrganizationService {
* @param level
* @param level
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getSpecialLevelOrgs"
)
@GetMapping
(
value
=
"/getSpecialLevelOrgs"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
Organization
>>
getSpecialLevelOrganizations
(
@RequestParam
(
"level"
)
Integer
level
);
R
<
List
<
Organization
>>
getSpecialLevelOrganizations
(
@RequestParam
(
"level"
)
Integer
level
);
}
}
src/main/java/cn/com/glsx/usercenter/api/feign/UserService.java
View file @
137b35a
...
@@ -5,6 +5,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
...
@@ -5,6 +5,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
import
cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory
;
import
cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -19,19 +20,19 @@ import java.util.List;
...
@@ -19,19 +20,19 @@ import java.util.List;
)
)
public
interface
UserService
{
public
interface
UserService
{
@GetMapping
(
value
=
"/findAll"
)
@GetMapping
(
value
=
"/findAll"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findAll
();
R
<
List
<
User
>>
findAll
();
@GetMapping
(
value
=
"/getById"
)
@GetMapping
(
value
=
"/getById"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
User
>
getById
(
@RequestParam
(
"id"
)
Long
id
);
R
<
User
>
getById
(
@RequestParam
(
"id"
)
Long
id
);
@GetMapping
(
value
=
"/findByUser"
)
@GetMapping
(
value
=
"/findByUser"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findByUser
(
FindUserRequest
request
);
R
<
List
<
User
>>
findByUser
(
FindUserRequest
request
);
@GetMapping
(
value
=
"/findByOrg"
)
@GetMapping
(
value
=
"/findByOrg"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
User
>>
findByOrg
(
FindUserRequest
request
);
R
<
List
<
User
>>
findByOrg
(
FindUserRequest
request
);
@GetMapping
(
value
=
"/findAllByOrg"
)
@GetMapping
(
value
=
"/findAllByOrg"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
R
<
List
<
User
>>
findAllByOrg
(
FindUserRequest
request
);
R
<
List
<
User
>>
findAllByOrg
(
FindUserRequest
request
);
}
}
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