Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
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
TCM
tcm-system
Commits
5b9f64b1
Commit
5b9f64b1
authored
Aug 20, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.20
parent
74429c28
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
0 deletions
+63
-0
RoleController.java
...com/pangding/web/authority/controller/RoleController.java
+16
-0
RoleService.java
.../java/com/pangding/web/authority/service/RoleService.java
+2
-0
RoleServiceImpl.java
.../pangding/web/authority/service/impl/RoleServiceImpl.java
+8
-0
AddReqVo.java
...in/java/com/pangding/web/authority/vo/reqvo/AddReqVo.java
+37
-0
No files found.
src/main/java/com/pangding/web/authority/controller/RoleController.java
View file @
5b9f64b1
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.controller;
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.controller;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.reqvo.AddReqVo
;
import
com.pangding.web.authority.vo.reqvo.CountByRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.CountByRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleReqVo
;
...
@@ -111,4 +112,19 @@ public class RoleController {
...
@@ -111,4 +112,19 @@ public class RoleController {
roleServiceImpl
.
delete
(
webRoleReqVo
);
roleServiceImpl
.
delete
(
webRoleReqVo
);
return
new
ResponseResult
();
return
new
ResponseResult
();
}
}
/**
* 给指定角色添加权限
* @param reqVo
* @return
*/
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
add
(
@RequestBody
AddReqVo
reqVo
){
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"roleId"
,
reqVo
.
getRoleId
())
.
notBlankCheck
(
"authorityId"
,
reqVo
.
getAuthorityId
())
.
checkException
();
roleServiceImpl
.
add
(
reqVo
);
return
new
ResponseResult
();
}
}
}
src/main/java/com/pangding/web/authority/service/RoleService.java
View file @
5b9f64b1
...
@@ -2,6 +2,7 @@ package com.pangding.web.authority.service;
...
@@ -2,6 +2,7 @@ package com.pangding.web.authority.service;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.reqvo.AddReqVo
;
import
com.pangding.web.authority.vo.reqvo.CountByRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.CountByRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleReqVo
;
...
@@ -108,4 +109,5 @@ public interface RoleService {
...
@@ -108,4 +109,5 @@ public interface RoleService {
*/
*/
PageSizeData
<
UserVo
>
countByRole
(
CountByRoleReqVo
reqVo
);
PageSizeData
<
UserVo
>
countByRole
(
CountByRoleReqVo
reqVo
);
void
add
(
AddReqVo
reqVo
);
}
}
src/main/java/com/pangding/web/authority/service/impl/RoleServiceImpl.java
View file @
5b9f64b1
...
@@ -310,4 +310,12 @@ public class RoleServiceImpl implements RoleService {
...
@@ -310,4 +310,12 @@ public class RoleServiceImpl implements RoleService {
public
PageSizeData
<
UserVo
>
countByRole
(
CountByRoleReqVo
reqVo
)
{
public
PageSizeData
<
UserVo
>
countByRole
(
CountByRoleReqVo
reqVo
)
{
return
userDaoImpl
.
countByRole
(
reqVo
);
return
userDaoImpl
.
countByRole
(
reqVo
);
}
}
@Override
public
void
add
(
AddReqVo
reqVo
)
{
RoleAuthorityVo
roleAuthorityVo
=
new
RoleAuthorityVo
();
ObjectHelper
.
writeWithFrom
(
roleAuthorityVo
,
reqVo
);
roleAuthorityVo
.
setId
(
StringHelper
.
getNewID
());
roleAuthorityDaoImpl
.
create
(
roleAuthorityVo
);
}
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/AddReqVo.java
0 → 100644
View file @
5b9f64b1
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/8/20 16:54
*/
public
class
AddReqVo
{
private
String
reqId
;
private
String
roleId
;
private
String
authorityId
;
public
String
getReqId
()
{
return
reqId
;
}
public
void
setReqId
(
String
reqId
)
{
this
.
reqId
=
reqId
;
}
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getAuthorityId
()
{
return
authorityId
;
}
public
void
setAuthorityId
(
String
authorityId
)
{
this
.
authorityId
=
authorityId
;
}
}
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