ExternalUserCreateReq.java
2.13 KB
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
package com.bs.web.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import java.util.List;
/**
* 对外创建用户请求参数
*/
@Data
public class ExternalUserCreateReq {
@Schema(name = "userName", description = "用户姓名(用户账号,最长 20 字符)", required = true, example = "张三", type = "String", hidden = false)
@NotBlank(message = "用户姓名不能为空")
@Size(max = 20, min = 1, message = "姓名最多 20 个字符")
private String userName;
@Schema(name = "deptId", description = "部门 ID", required = true, example = "1", type = "Long", hidden = false)
@NotNull(message = "部门 ID 不能为空")
private Long deptId;
@Schema(name = "position", description = "职务", required = false, example = "工程师", type = "String", hidden = false)
@Size(max = 50, message = "职务最长 50 个字符")
private String position;
@Schema(name = "phoneNumber", description = "手机号码", required = true, example = "13888888888", type = "String", hidden = false)
@NotBlank(message = "手机号不能为空")
@Size(max = 11, min = 11, message = "手机号长度仅限 11 位数字")
@Pattern(regexp = "^1\\d{10}$", message = "手机号格式不正确,请输入有效的 11 位手机号")
private String phoneNumber;
@Schema(name = "roleIds", description = "角色 ID 列表", required = true, example = "[1,2]", type = "List<Long>", hidden = false)
@NotNull(message = "角色 ID 列表不能为空")
private List<Long> roleIds;
@Schema(name = "dataScope", description = "数据范围(1-全部,2-自定义,3-本部门,4-本部门及以下,5-本人)", required = false, example = "5", type = "Integer", hidden = false)
private Integer dataScope;
@Schema(name = "password", description = "用户密码", required = false, example = "123456", type = "String", hidden = false)
private String password;
}