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;
|
}
|
|
}
|