Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
07a596d0
Commit
07a596d0
authored
Jun 18, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量拿用户信息
parent
94a62b19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
UserFeign.java
...va/com/github/wxiaoqi/security/admin/feign/UserFeign.java
+4
-0
PublicController.java
.../github/wxiaoqi/security/admin/rest/PublicController.java
+23
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/UserFeign.java
View file @
07a596d0
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${DESCRIPTION}
...
...
@@ -38,6 +39,9 @@ public interface UserFeign {
@RequestMapping
(
value
=
"/member/levels"
,
method
=
RequestMethod
.
GET
)
public
List
<
BaseUserMemberLevel
>
levels
();
@RequestMapping
(
value
=
"/public/app/userinfo-by-id"
)
public
Map
<
Integer
,
Object
>
userDetailById
(
List
<
Integer
>
userids
);
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/PublicController.java
View file @
07a596d0
...
...
@@ -17,11 +17,15 @@ import com.github.wxiaoqi.security.common.msg.BaseResponse;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
io.swagger.models.auth.In
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${DESCRIPTION}
...
...
@@ -69,4 +73,23 @@ public class PublicController {
}
return
new
ObjectRestResponse
<
AppUserDetail
>().
rel
(
true
).
data
(
user
);
}
//批量获取用户信息
@RequestMapping
(
value
=
"/app/userinfo-by-id"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
Map
<
Integer
,
Object
>
userDetailById
(
List
<
Integer
>
userids
)
throws
Exception
{
Map
<
Integer
,
Object
>
map
=
new
HashMap
<>();
for
(
Integer
userid:
userids
)
{
AppUserDetail
user
=
detailBiz
.
getUserByUserid
(
userid
);
if
(
user
==
null
)
{
user
=
new
AppUserDetail
();
user
.
setHeadimgurl
(
SystemConfig
.
USER_HEADER_URL_DEFAULT
);
}
map
.
put
(
userid
,
user
);
}
return
map
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment