commit | author | age
|
9bcb19
|
1 |
/* |
I |
2 |
Copyright [2020] [https://www.xiaonuo.vip] |
|
3 |
|
|
4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
you may not use this file except in compliance with the License. |
|
6 |
You may obtain a copy of the License at |
|
7 |
|
|
8 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
|
|
10 |
Unless required by applicable law or agreed to in writing, software |
|
11 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
See the License for the specific language governing permissions and |
|
14 |
limitations under the License. |
|
15 |
|
|
16 |
Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: |
|
17 |
|
|
18 |
1.请不要删除和修改根目录下的LICENSE文件。 |
|
19 |
2.请不要删除和修改Snowy源码头部的版权声明。 |
|
20 |
3.请保留源码和相关描述文件的项目出处,作者声明等。 |
|
21 |
4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
|
22 |
5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy |
|
23 |
6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip |
|
24 |
*/ |
|
25 |
package vip.xiaonuo.sys.modular.role.controller; |
|
26 |
|
|
27 |
import org.springframework.validation.annotation.Validated; |
|
28 |
import org.springframework.web.bind.annotation.GetMapping; |
|
29 |
import org.springframework.web.bind.annotation.PostMapping; |
|
30 |
import org.springframework.web.bind.annotation.RequestBody; |
|
31 |
import org.springframework.web.bind.annotation.RestController; |
|
32 |
import vip.xiaonuo.core.annotion.BusinessLog; |
|
33 |
import vip.xiaonuo.core.annotion.DataScope; |
|
34 |
import vip.xiaonuo.core.annotion.Permission; |
|
35 |
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum; |
|
36 |
import vip.xiaonuo.core.pojo.response.ResponseData; |
|
37 |
import vip.xiaonuo.core.pojo.response.SuccessResponseData; |
|
38 |
import vip.xiaonuo.sys.modular.role.param.SysRoleParam; |
|
39 |
import vip.xiaonuo.sys.modular.role.service.SysRoleService; |
|
40 |
|
|
41 |
import javax.annotation.Resource; |
|
42 |
|
|
43 |
/** |
|
44 |
* 系统角色控制器 |
|
45 |
* |
|
46 |
* @author xuyuxiang |
|
47 |
* @date 2020/3/20 19:42 |
|
48 |
*/ |
|
49 |
@RestController |
|
50 |
public class SysRoleController { |
|
51 |
|
|
52 |
@Resource |
|
53 |
private SysRoleService sysRoleService; |
|
54 |
|
|
55 |
/** |
|
56 |
* 查询系统角色 |
|
57 |
* |
|
58 |
* @author xuyuxiang |
|
59 |
* @date 2020/3/28 14:45 |
|
60 |
*/ |
|
61 |
@Permission |
|
62 |
@GetMapping("/sysRole/page") |
|
63 |
@BusinessLog(title = "系统角色_查询", opType = LogAnnotionOpTypeEnum.QUERY) |
|
64 |
public ResponseData page(SysRoleParam sysRoleParam) { |
|
65 |
return new SuccessResponseData(sysRoleService.page(sysRoleParam)); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* 系统角色下拉(用于授权角色时选择) |
|
70 |
* |
|
71 |
* @author xuyuxiang |
|
72 |
* @date 2020/4/5 16:45 |
|
73 |
*/ |
|
74 |
@Permission |
|
75 |
@GetMapping("/sysRole/dropDown") |
|
76 |
@BusinessLog(title = "系统角色_下拉", opType = LogAnnotionOpTypeEnum.QUERY) |
|
77 |
public ResponseData dropDown() { |
|
78 |
return new SuccessResponseData(sysRoleService.dropDown()); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* 添加系统角色 |
|
83 |
* |
|
84 |
* @author xuyuxiang |
|
85 |
* @date 2020/3/28 14:45 |
|
86 |
*/ |
|
87 |
@Permission |
|
88 |
@PostMapping("/sysRole/add") |
|
89 |
@BusinessLog(title = "系统角色_增加", opType = LogAnnotionOpTypeEnum.ADD) |
|
90 |
public ResponseData add(@RequestBody @Validated(SysRoleParam.add.class) SysRoleParam sysRoleParam) { |
|
91 |
sysRoleService.add(sysRoleParam); |
|
92 |
return new SuccessResponseData(); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* 删除系统角色 |
|
97 |
* |
|
98 |
* @author xuyuxiang |
|
99 |
* @date 2020/3/28 14:45 |
|
100 |
*/ |
|
101 |
@Permission |
|
102 |
@PostMapping("/sysRole/delete") |
|
103 |
@BusinessLog(title = "系统角色_删除", opType = LogAnnotionOpTypeEnum.DELETE) |
|
104 |
public ResponseData delete(@RequestBody @Validated(SysRoleParam.delete.class) SysRoleParam sysRoleParam) { |
|
105 |
sysRoleService.delete(sysRoleParam); |
|
106 |
return new SuccessResponseData(); |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* 编辑系统角色 |
|
111 |
* |
|
112 |
* @author xuyuxiang |
|
113 |
* @date 2020/3/28 14:46 |
|
114 |
*/ |
|
115 |
@Permission |
|
116 |
@PostMapping("/sysRole/edit") |
|
117 |
@BusinessLog(title = "系统角色_编辑", opType = LogAnnotionOpTypeEnum.EDIT) |
|
118 |
public ResponseData edit(@RequestBody @Validated(SysRoleParam.edit.class) SysRoleParam sysRoleParam) { |
|
119 |
sysRoleService.edit(sysRoleParam); |
|
120 |
return new SuccessResponseData(); |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
124 |
* 查看系统角色 |
|
125 |
* |
|
126 |
* @author xuyuxiang |
|
127 |
* @date 2020/3/28 14:46 |
|
128 |
*/ |
|
129 |
@Permission |
|
130 |
@GetMapping("/sysRole/detail") |
|
131 |
@BusinessLog(title = "系统角色_查看", opType = LogAnnotionOpTypeEnum.DETAIL) |
|
132 |
public ResponseData detail(@Validated(SysRoleParam.detail.class) SysRoleParam sysRoleParam) { |
|
133 |
return new SuccessResponseData(sysRoleService.detail(sysRoleParam)); |
|
134 |
} |
|
135 |
|
|
136 |
/** |
|
137 |
* 授权菜单 |
|
138 |
* |
|
139 |
* @author xuyuxiang |
|
140 |
* @date 2020/3/28 16:05 |
|
141 |
*/ |
|
142 |
@Permission |
|
143 |
@PostMapping("/sysRole/grantMenu") |
|
144 |
@BusinessLog(title = "系统角色_授权菜单", opType = LogAnnotionOpTypeEnum.GRANT) |
|
145 |
public ResponseData grantMenu(@RequestBody @Validated(SysRoleParam.grantMenu.class) SysRoleParam sysRoleParam) { |
|
146 |
sysRoleService.grantMenu(sysRoleParam); |
|
147 |
return new SuccessResponseData(); |
|
148 |
} |
|
149 |
|
|
150 |
/** |
|
151 |
* 授权数据 |
|
152 |
* |
|
153 |
* @author xuyuxiang |
|
154 |
* @date 2020/3/28 16:05 |
|
155 |
*/ |
|
156 |
@Permission |
|
157 |
@DataScope |
|
158 |
@PostMapping("/sysRole/grantData") |
|
159 |
@BusinessLog(title = "系统角色_授权数据", opType = LogAnnotionOpTypeEnum.GRANT) |
|
160 |
public ResponseData grantData(@RequestBody @Validated(SysRoleParam.grantData.class) SysRoleParam sysRoleParam) { |
|
161 |
sysRoleService.grantData(sysRoleParam); |
|
162 |
return new SuccessResponseData(); |
|
163 |
} |
|
164 |
|
|
165 |
/** |
|
166 |
* 拥有菜单 |
|
167 |
* |
|
168 |
* @author xuyuxiang |
|
169 |
* @date 2020/3/28 14:46 |
|
170 |
*/ |
|
171 |
@Permission |
|
172 |
@GetMapping("/sysRole/ownMenu") |
|
173 |
@BusinessLog(title = "系统角色_拥有菜单", opType = LogAnnotionOpTypeEnum.DETAIL) |
|
174 |
public ResponseData ownMenu(@Validated(SysRoleParam.detail.class) SysRoleParam sysRoleParam) { |
|
175 |
return new SuccessResponseData(sysRoleService.ownMenu(sysRoleParam)); |
|
176 |
} |
|
177 |
|
|
178 |
/** |
|
179 |
* 拥有数据 |
|
180 |
* |
|
181 |
* @author xuyuxiang |
|
182 |
* @date 2020/3/28 14:46 |
|
183 |
*/ |
|
184 |
@Permission |
|
185 |
@GetMapping("/sysRole/ownData") |
|
186 |
@BusinessLog(title = "系统角色_拥有数据", opType = LogAnnotionOpTypeEnum.DETAIL) |
|
187 |
public ResponseData ownData(@Validated(SysRoleParam.detail.class) SysRoleParam sysRoleParam) { |
|
188 |
return new SuccessResponseData(sysRoleService.ownData(sysRoleParam)); |
|
189 |
} |
|
190 |
|
|
191 |
} |