xuhy
2025-01-09 87f0dfb91e489ca09d73e87379b8f7f90aa5ea6e
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
package com.jilongda.applet.model;
 
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jilongda.common.pojo.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
 
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;
 
/**
 * <p>
 *
 * </p>
 *
 * @author xiaochen
 * @since 2022-06-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sec_user")
@ApiModel(value = "SecUser对象", description = "")
public class SecUser extends BaseModel {
 
    private static final long serialVersionUID = 1L;
 
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    @ApiModelProperty(value = "账户")
    @Length(max = 18, message = "账户最多输入18个字符")
    @TableField("account")
    @Excel(name = "账号_唯一:中英文1-10个字符:禁止回车、空格等特殊字符", width = 15, orderNum = "1")
    private String account;
 
    @ApiModelProperty(value = "密码")
    @TableField("password")
    @Length(min = 6, max = 16, message = "密码可输入6~16个字符")
    @Excel(name = "密码_中英文1-10个字符", width = 15, orderNum = "2")
    private String password;
 
    @ApiModelProperty(value = "用户描述")
    @TableField("description")
    private String description;
 
    @ApiModelProperty(value = "手机号码")
    @TableField("phone")
    @Length(min = 6, max = 11, message = "手机号码可输入6~11位")
    @NotNull(message = "手机号不可为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    @Excel(name = "手机号", width = 15, orderNum = "4")
    private String phone;
 
    @ApiModelProperty(value = "账户状态 是否禁用")
    @TableField("state")
    private Boolean state;
 
    @ApiModelProperty(value = "最近一次登陆时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;
 
    @ApiModelProperty(value = "用户昵称")
    @TableField("nick_name")
    private String nickName;
 
    @ApiModelProperty(value = "微信头像地址")
    @TableField("avatar_url")
    private String avatarUrl;
 
    @ApiModelProperty(value = "省")
    @TableField("province")
    private String province;
 
    @ApiModelProperty(value = "市")
    @TableField("city")
    private String city;
 
    @ApiModelProperty(value = "区")
    @TableField("area")
    private String area;
 
    @ApiModelProperty(value = "详细地址")
    @TableField("address")
    private String address;
 
    @ApiModelProperty(value = "生日")
    @TableField("birthday")
    private LocalDateTime birthday;
 
    @ApiModelProperty(value = "1男2女0未知")
    @TableField("gender")
    private Integer gender;
 
    @ApiModelProperty(value = "部门id")
    @TableField("deptId")
    private Long deptId;
 
    @ApiModelProperty(value = "类型1平台管理员2验光师3员工")
    @TableField("userType")
    private Integer userType;
    @ApiModelProperty(value = "门店id")
    @TableField("storeId")
    private Integer storeId;
    @ApiModelProperty(value = "省code")
    @TableField("provinceCode")
    private String provinceCode;
    @ApiModelProperty(value = "市code")
    @TableField("cityCode")
    private String cityCode;
    @ApiModelProperty(value = "区code")
    @TableField("areaCode")
    private String areaCode;
    @ApiModelProperty(value = "图片")
    @TableField("pictures")
    private String pictures;
 
    public boolean isAdmin()
    {
        return isAdmin(this.id);
    }
 
    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }
 
 
}