Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
online-edu
online-edu-backend
Commits
7b091318
Commit
7b091318
authored
Apr 27, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字典表管理添加权限
parent
03be9737
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
SysConfigController.java
...va/com/qkdata/biz/sys/controller/SysConfigController.java
+8
-0
No files found.
src/main/java/com/qkdata/biz/sys/controller/SysConfigController.java
View file @
7b091318
package
com
.
qkdata
.
biz
.
sys
.
controller
;
package
com
.
qkdata
.
biz
.
sys
.
controller
;
import
com.qkdata.biz.common.BizConstants
;
import
com.qkdata.biz.sys.entity.SysConfigPO
;
import
com.qkdata.biz.sys.entity.SysConfigPO
;
import
com.qkdata.biz.sys.service.SysConfigService
;
import
com.qkdata.biz.sys.service.SysConfigService
;
import
com.qkdata.biz.sys.vo.QueryConfigModel
;
import
com.qkdata.biz.sys.vo.QueryConfigModel
;
...
@@ -8,6 +9,8 @@ import com.qkdata.common.base.model.PageResult;
...
@@ -8,6 +9,8 @@ import com.qkdata.common.base.model.PageResult;
import
com.qkdata.common.base.model.Result
;
import
com.qkdata.common.base.model.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -22,12 +25,14 @@ public class SysConfigController {
...
@@ -22,12 +25,14 @@ public class SysConfigController {
@ApiOperation
(
"查询列表"
)
@ApiOperation
(
"查询列表"
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
},
logical
=
Logical
.
OR
)
public
PageResult
<
SysConfigPO
>
list
(
@RequestBody
QueryConfigModel
queryConfigModel
){
public
PageResult
<
SysConfigPO
>
list
(
@RequestBody
QueryConfigModel
queryConfigModel
){
return
sysConfigService
.
queryPageList
(
queryConfigModel
);
return
sysConfigService
.
queryPageList
(
queryConfigModel
);
}
}
@ApiOperation
(
"获取单条信息"
)
@ApiOperation
(
"获取单条信息"
)
@GetMapping
(
"/info/{id}"
)
@GetMapping
(
"/info/{id}"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
},
logical
=
Logical
.
OR
)
public
Result
<
SysConfigPO
>
info
(
@PathVariable
Long
id
){
public
Result
<
SysConfigPO
>
info
(
@PathVariable
Long
id
){
return
Result
.
succeed
(
sysConfigService
.
getById
(
id
));
return
Result
.
succeed
(
sysConfigService
.
getById
(
id
));
}
}
...
@@ -35,6 +40,7 @@ public class SysConfigController {
...
@@ -35,6 +40,7 @@ public class SysConfigController {
@SysLog
(
"保存字典数据"
)
@SysLog
(
"保存字典数据"
)
@ApiOperation
(
"保存"
)
@ApiOperation
(
"保存"
)
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
},
logical
=
Logical
.
OR
)
public
Result
<
String
>
save
(
@RequestBody
SysConfigPO
sysConfigPO
){
public
Result
<
String
>
save
(
@RequestBody
SysConfigPO
sysConfigPO
){
sysConfigService
.
save
(
sysConfigPO
);
sysConfigService
.
save
(
sysConfigPO
);
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
@@ -43,6 +49,7 @@ public class SysConfigController {
...
@@ -43,6 +49,7 @@ public class SysConfigController {
@SysLog
(
"修改字典数据"
)
@SysLog
(
"修改字典数据"
)
@ApiOperation
(
"更新"
)
@ApiOperation
(
"更新"
)
@PostMapping
(
"/update"
)
@PostMapping
(
"/update"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
},
logical
=
Logical
.
OR
)
public
Result
<
String
>
update
(
@RequestBody
SysConfigPO
sysConfigPO
){
public
Result
<
String
>
update
(
@RequestBody
SysConfigPO
sysConfigPO
){
sysConfigService
.
updateById
(
sysConfigPO
);
sysConfigService
.
updateById
(
sysConfigPO
);
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
@@ -51,6 +58,7 @@ public class SysConfigController {
...
@@ -51,6 +58,7 @@ public class SysConfigController {
@SysLog
(
"删除字典数据"
)
@SysLog
(
"删除字典数据"
)
@ApiOperation
(
"删除"
)
@ApiOperation
(
"删除"
)
@PostMapping
(
"/delete"
)
@PostMapping
(
"/delete"
)
@RequiresRoles
(
value
=
{
BizConstants
.
ROLE_ADMIN
,
BizConstants
.
ROLE_OPERATOR
},
logical
=
Logical
.
OR
)
public
Result
<
String
>
delete
(
@RequestBody
Long
[]
ids
){
public
Result
<
String
>
delete
(
@RequestBody
Long
[]
ids
){
sysConfigService
.
removeByIds
(
Arrays
.
asList
(
ids
));
sysConfigService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
...
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