package com.jilongda.manage.authority.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;
|
}
|
|
|
}
|