package com.ningdatech.carapi.user.entity;

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.ningdatech.carapi.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 *
 * </p>
 *
 * @author LiuXinXin
 * @since 2022-09-30
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("nd_user_info")
@ApiModel(value = "User", description = "用户")
@AllArgsConstructor
@Builder
public class NdUserInfo extends BaseEntity implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    private static final long serialVersionUID = 1L;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value = "用户姓名")
    @NotEmpty(message = "用户姓名不能为空")
    @Size(max = 50, message = "用户姓名长度不能超过50")
    @TableField(value = "username", condition = LIKE)
    private String username;

    /**
     * 企业
     */
    @ApiModelProperty(value = "企业id")
    @TableField("company_id")
    private Long companyId;

    /**
     * 公司行业
     */
    @ApiModelProperty(value = "行业id")
    @TableField("industry")
    private Long industry;

    /**
     * 手机
     */
    @ApiModelProperty(value = "手机")
    @Size(max = 20, message = "手机长度不能超过20")
    @TableField(value = "mobile", condition = LIKE)
    private String mobile;

    /**
     * 最后登录时间
     */
    @ApiModelProperty(value = "最后登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;

    /**
     * 职位
     */
    @ApiModelProperty(value = "职位")
    @Size(max = 50, message = "职位长度不能超过50")
    @TableField(value = "position", condition = LIKE)
    private String position;

    /**
     * 科室
     */
    @ApiModelProperty(value = "科室")
    @Size(max = 50, message = "科室长度不能超过50")
    @TableField(value = "section_office", condition = LIKE)
    private String sectionOffice;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    @Size(max = 50, message = "昵称长度不能超过50")
    @TableField(value = "nick_name", condition = LIKE)
    private String nickName;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 200, message = "备注不能超过200")
    @TableField(value = "remark", condition = LIKE)
    private String remark;

    /**
     * 用户是否可登录
     */
    @ApiModelProperty(value = "用户是否可登录")
    @TableField("can_login")
    private Integer canLogin;

    /**
     * 用户登录验证码
     */
    @ApiModelProperty(value = "用户登录验证码")
    @TableField("verification_code")
    private String verificationCode;

}
