kong
2026-04-12 7f3081da3c0597cfbfc8f0fc4e342c4ceb901f6d
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
package com.xiaopeng.api.model.account;
 
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.xiaopeng.common.core.annotation.Excel;
import com.xiaopeng.common.core.annotation.Excel.ColumnType;
import com.xiaopeng.common.core.web.domain.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
 
import javax.validation.constraints.NotBlank;
import java.util.List;
 
/**
 * 用户对象 sys_user
 * 
 * @author ruoyi
 */
@Data
public class SysUser extends BaseModel
{
    private static final long serialVersionUID = 1L;
 
    /** 用户ID */
    @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    @ApiModelProperty(value = "唯一值编号")
    private String uniqueNumber;
 
    /** 用户账号 */
    @ApiModelProperty(value = "用户账号")
    private String userAccount;
 
    /** 用户昵称 */
    @Excel(name = "用户昵称")
    @NotBlank(message = "姓名不能为空")
    @TableField("nick_name")
    @ApiModelProperty(value = "用户昵称")
    private String nickName;
 
    /** 手机号码 */
    @Excel(name = "手机号码")
    @NotBlank(message = "请输入手机号码")
    @ApiModelProperty(value = "手机号码")
    private String phoneNumber;
 
    /** 用户头像 */
    @ApiModelProperty(value = "用户头像")
    private String avatar;
 
    /** 密码 */
    private String password;
 
    /** 帐号状态(0正常 1停用) */
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    @ApiModelProperty(value = "帐号状态 0=正常,1=停用")
    private Integer status;
 
    @ApiModelProperty(value = "备注")
    private String remarks;
 
    /** 角色对象 */
    @TableField(exist = false)
    private List<SysRole> roles;
 
    /** 角色组 */
    @TableField(exist = false)
    private Long[] roleIds;
 
    /** 岗位组 */
    @TableField(exist = false)
    private Long[] postIds;
 
    /** 角色ID */
    @TableField(exist = false)
    @ApiModelProperty(value = "角色ID")
    private Long roleId;
 
    @ApiModelProperty(value = "角色")
    @TableField(exist = false)
    private List<String> roleNames;
 
    @TableField(exist = false)
    private Long deptId;
 
    @ApiModelProperty(value = "角色名称")
    @TableField(exist = false)
    private String roleName;
 
    public boolean isAdmin()
    {
        return isAdmin(this.id);
    }
 
    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }
 
}