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
2117728c
Commit
2117728c
authored
May 14, 2019
by
youjj
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5274a13d
5ab14cf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
UserController.java
...om/github/wxiaoqi/security/admin/rest/UserController.java
+15
-11
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserController.java
View file @
2117728c
...
...
@@ -12,10 +12,8 @@ import com.github.wxiaoqi.security.admin.vo.MenuTree;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
lombok.Data
;
...
...
@@ -24,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -66,14 +63,22 @@ public class UserController extends CommonBaseController {
//内部类
@Data
public
static
class
AddUserDT
O
extends
User
{
public
static
class
UserV
O
extends
User
{
List
<
Integer
>
dataLimit
;
List
<
Integer
>
members
;
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
@IgnoreClientToken
public
ObjectRestResponse
<
User
>
add
(
@RequestBody
AddUserDTO
dto
){
public
ObjectRestResponse
<
User
>
add
(
@RequestBody
UserVO
vo
){
handleDataLimit
(
vo
);
userBiz
.
insertSelective
(
vo
);
//添加权限关系
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
return
new
ObjectRestResponse
();
}
private
void
handleDataLimit
(
@RequestBody
UserVO
dto
)
{
if
(
null
!=
dto
.
getDataLimit
())
{
if
(
dto
.
getDataLimit
().
contains
(
CURRENT_COMPANY
))
{
dto
.
setDataCompany
(
dto
.
getCompanyId
().
toString
());
...
...
@@ -85,10 +90,6 @@ public class UserController extends CommonBaseController {
dto
.
setDataAll
(
DATA_ALL_TRUE
);
}
}
userBiz
.
insertSelective
(
dto
);
//添加权限关系
groupBiz
.
modifyUserGroups
(
dto
.
getId
(),
dto
.
getMembers
());
return
new
ObjectRestResponse
();
}
@RequestMapping
(
value
=
"/front/info"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -145,8 +146,11 @@ public class UserController extends CommonBaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ObjectRestResponse
<
User
>
update
(
@RequestBody
User
entity
){
userBiz
.
updateSelectiveById
(
entity
);
public
ObjectRestResponse
<
User
>
update
(
@RequestBody
UserVO
vo
){
handleDataLimit
(
vo
);
userBiz
.
updateSelectiveById
(
vo
);
//添加权限关系
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
return
new
ObjectRestResponse
<
User
>();
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
...
...
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