goupan
2024-04-03 5506e9a45e717ffcb67ec313b5a4e8206d9b3a39
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/*
 * Copyright [2020-2030] [https://www.stylefeng.cn]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Guns源码头部的版权声明。
 * 3.请保留源码和相关描述文件的项目出处,作者声明等。
 * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
 * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
 * 6.若您的项目无法满足以上几点,可申请商业授权
 */
package cn.stylefeng.roses.kernel.system.api.pojo.role.request;
 
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.roses.kernel.validator.api.validators.unique.TableUniqueValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.math.BigDecimal;
import java.util.List;
 
/**
 * 系统角色参数
 *
 * @author majianguo
 * @date 2020/11/5 下午4:32
 */
@ApiModel(value = "系统角色参数")
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRoleRequest extends BaseRequest {
 
    /**
     * 主键
     */
    @NotNull(message = "roleId不能为空", groups = {edit.class, delete.class, detail.class, updateStatus.class, grantResource.class, grantResourceV2.class, grantDataScope.class,
            grantMenuButton.class, grantMenu.class, grantButton.class, grantMenusAndButtons.class, roleBindMenuList.class, grantRoleMenus.class, grantAll.class})
    @ApiModelProperty("主键")
    @ChineseDescription("主键")
    private Long roleId;
 
    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空", groups = {add.class, edit.class})
    @ApiModelProperty("角色名称")
    @ChineseDescription("角色名称")
    private String roleName;
 
    /**
     * 角色编码
     */
    @NotBlank(message = "角色编码不能为空", groups = {add.class, edit.class})
    @TableUniqueValue(message = "角色编码存在重复", groups = {add.class, edit.class}, tableName = "sys_role", columnName = "role_code", idFieldName = "role_id", excludeLogicDeleteItems = true)
    @ApiModelProperty("角色编码")
    @ChineseDescription("角色编码")
    private String roleCode;
 
    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {add.class, edit.class})
    @ApiModelProperty("排序")
    @ChineseDescription("排序")
    private BigDecimal roleSort;
 
    /**
     * 数据范围类型:10-仅本人数据,20-本部门数据,30-本部门及以下数据,40-指定部门数据,50-全部数据
     */
    @Null(message = "数据范围类型应该为空", groups = {add.class, edit.class})
    @NotNull(message = "数据范围类型不能为空", groups = {grantDataScope.class})
    @ApiModelProperty("数据范围类型:10-仅本人数据,20-本部门数据,30-本部门及以下数据,40-指定部门数据,50-全部数据")
    @ChineseDescription("数据范围类型:10-仅本人数据,20-本部门数据,30-本部门及以下数据,40-指定部门数据,50-全部数据")
    private Integer dataScopeType;
 
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    @ChineseDescription("备注")
    private String remark;
 
    /**
     * 状态(字典 1正常 2停用)
     */
    @ApiModelProperty("状态(字典 1正常 2停用)")
    @ChineseDescription("状态(字典 1正常 2停用)")
    private Integer statusFlag;
 
    /**
     * 是否是系统角色:Y-是,N-否
     */
    @ApiModelProperty("是否是系统角色:Y-是,N-否")
    @ChineseDescription("是否是系统角色:Y-是,N-否")
    private String roleSystemFlag;
 
    /**
     * 角色类型
     */
    @ApiModelProperty("角色类型")
    @ChineseDescription("角色类型")
    private String roleTypeCode;
 
    /**
     * 授权资源
     */
    @NotNull(message = "授权资源不能为空", groups = {grantResource.class})
    @ApiModelProperty("授权资源")
    @ChineseDescription("授权资源")
    private List<String> grantResourceList;
 
    /**
     * 授权资源,模块组包含的所有资源
     */
    @ApiModelProperty("授权资源,模块组包含的所有资源")
    @ChineseDescription("授权资源,模块组包含的所有资源")
    private List<String> modularTotalResource;
 
    /**
     * 授权资源,模块组选中的资源
     */
    @ApiModelProperty("授权资源,模块组选中的资源")
    @ChineseDescription("授权资源,模块组选中的资源")
    private List<String> selectedResource;
 
    /**
     * 授权数据
     */
    @ApiModelProperty("授权数据")
    @ChineseDescription("授权数据")
    private List<Long> grantOrgIdList;
 
    /**
     * 授权菜单
     */
    @NotEmpty(message = "授权菜单Id不能为空", groups = {grantMenuButton.class, grantMenusAndButtons.class, grantRoleMenus.class})
    @ApiModelProperty("授权菜单")
    @ChineseDescription("授权菜单")
    private List<Long> grantMenuIdList;
 
    /**
     * 授权菜单按钮
     */
    @NotNull(message = "授权菜单按钮Id不能为空", groups = {grantMenuButton.class})
    @ApiModelProperty("授权菜单按钮")
    @ChineseDescription("授权菜单按钮")
    private List<SysRoleMenuButtonRequest> grantMenuButtonIdList;
 
    /**
     * 是否是新增绑定菜单,true-新增绑定菜单,false-取消绑定菜单
     */
    @NotNull(message = "是否是新增绑定菜单", groups = {grantMenu.class})
    @ApiModelProperty("是否是新增绑定菜单,true-新增绑定菜单,false-取消绑定菜单")
    @ChineseDescription("是否是新增绑定菜单,true-新增绑定菜单,false-取消绑定菜单")
    private Boolean grantAddMenuFlag;
 
    /**
     * 绑定菜单的id
     */
    @NotNull(message = "绑定菜单的id", groups = {grantMenu.class})
    @ApiModelProperty("绑定菜单的id")
    @ChineseDescription("绑定菜单的id")
    private Long grantMenuId;
 
    /**
     * 模块下所有的按钮id
     */
    @ApiModelProperty("模块下所有的按钮id")
    @ChineseDescription("模块下所有的按钮id")
    private List<Long> modularButtonIds;
 
    /**
     * 模块下选中的按钮id
     */
    @ApiModelProperty("模块下选中的按钮id")
    @ChineseDescription("模块下选中的按钮id")
    private List<Long> selectedButtonIds;
 
    /**
     * 绑定标识,true-新增绑定菜单,false-取消绑定菜单
     */
    @ApiModelProperty("绑定标识,true-新增绑定菜单,false-取消绑定菜单")
    @ChineseDescription("绑定标识,true-新增绑定菜单,false-取消绑定菜单")
    @NotNull(message = "绑定标识不能为空", groups = {grantMenusAndButtons.class, grantRoleMenus.class})
    private Boolean selectBindFlag;
 
    /**
     * 资源的业务类型:1-业务类型,2-系统类型
     */
    @ApiModelProperty("资源的业务类型:1-业务类型,2-系统类型")
    @ChineseDescription("资源的业务类型:1-业务类型,2-系统类型")
    private Integer resourceBizType;
 
    /**
     * 全选标识:true-全选,false-取消全选
     */
    @ApiModelProperty("全选标识:true-全选,false-取消全选")
    @ChineseDescription("全选标识:true-全选,false-取消全选")
    @NotNull(message = "全选标识不能为空", groups = {grantAll.class})
    private Boolean totalSelectFlag;
 
    /**
     * 是否是管理员角色,管理员角色只能管理后台相关菜单
     */
    @ApiModelProperty("是否是管理员角色,管理员角色只能管理后台相关菜单")
    @ChineseDescription("是否是管理员角色,管理员角色只能管理后台相关菜单")
    private String adminFlag;
 
    /**
     * 角色id集合
     */
    @ApiModelProperty("角色id集合")
    @ChineseDescription("角色id集合")
    @NotEmpty(message = "角色id集合不能为空", groups = {batchQuery.class})
    private List<Long> roleIdList;
 
    /**
     * 参数校验分组:授权菜单和按钮
     */
    public @interface grantMenuButton {
 
    }
 
    /**
     * 参数校验分组:角色授权菜单
     */
    public @interface grantMenu {
 
    }
 
    /**
     * 参数校验分组:角色授权按钮
     */
    public @interface grantButton {
 
    }
 
    /**
     * 参数校验分组:授权资源
     */
    public @interface grantResource {
 
    }
 
    /**
     * 参数校验分组:授权资源
     */
    public @interface grantResourceV2 {
 
    }
 
    /**
     * 参数校验分组:授权数据
     */
    public @interface grantDataScope {
 
    }
 
    /**
     * 参数校验分组:授权菜单和按钮集合
     */
    public @interface grantMenusAndButtons {
 
    }
 
    /**
     * 获取角色绑定的菜单列表
     */
    public @interface roleBindMenuList {
    }
 
    /**
     * 绑定角色菜单
     */
    public @interface grantRoleMenus {
    }
 
    /**
     * 角色分配菜单,绑定全部菜单或取消绑定全部菜单
     */
    public @interface grantAll {
    }
 
    /**
     * 批量查询角色
     */
    public @interface batchQuery {
 
    }
 
}