package com.huatek.frame.base.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;

import com.huatek.torch.frame.validate.KerCheck;
import com.huatek.torch.frame.validate.KerMode;
import com.huatek.torch.sql.annotation.FieldName;
import com.huatek.torch.sql.annotation.Id;
import com.huatek.torch.sql.annotation.TableName;
import com.huatek.torch.sql.beans.Pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * 系统_用户 entity
 *
 * @author key_dong
 * @date 2018-7-11 12:37:46
 */
@Setter
@Getter
@TableName("sys_user")
public class User extends Pojo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3296453287013719074L;

	/**
	 * 是否领导(0 否 1是)
	 */
	@ApiModelProperty(value="父是否领导(0 否 1是)",name="leader",required=true)
	@FieldName("leader")
	private String leader;

	/**
	 * 用户编号
	 */
	@ApiModelProperty(value="用户编码",name="userCode",required=true)
	@KerCheck(rule = KerMode.NOT_BLANK, ruleMessage = "USER.USERCODE.NOTBLANK", max = 8, maxMessage = "USER.USERCODE.LENGTH")
	@FieldName("user_code")
	private String userCode;

	/**
	 * 用户名
	 */
	@ApiModelProperty(value="用户名",name="userName",required=true)
	@KerCheck(rule = KerMode.NOT_BLANK, ruleMessage = "USER.USERNAME.NOTBLANK", max = 8, maxMessage = "USER.USERNAME.LENGTH")
	@FieldName("user_name")
	private String userName;

	/**
	 * 移动电话
	 */
	@ApiModelProperty(value="移动电话",name="userMobile",required=true)
	@KerCheck(regex = "^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$", regexMessage = "USER.USERMOBILE.LAYOUT")
	@FieldName("user_mobile")
	private String userMobile;

	/**
	 * 邮箱
	 */
	@ApiModelProperty(value="邮箱",name="userEmail",required=true)
	@KerCheck(max = 64, maxMessage = "USER.USEREMAIL.LENGTH", regex = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$", regexMessage = "USER.USEREMAIL.LAYOUT")
	@FieldName("user_email")
	private String userEmail;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value="创建时间",name="createTime",required=true)
	@FieldName("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;

	/**
	 * 语言类型
	 */
	@ApiModelProperty(value="语言类型",name="languageType",required=true)
	@FieldName("language_type")
	private String languageType;

	/**
	 * 密码盐
	 */
	@FieldName("password_salt")
	private String passwordSalt;

	/**
	 * 密码
	 */
	@FieldName("password")
	private String password;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value="修改时间",name="updateTime",required=true)
	@FieldName("update_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime updateTime;

	/**
	 * 是否删除(0 否 1是)
	 */
	@ApiModelProperty(value="是否删除(0 否 1是)",name="deleted",required=true)
	@FieldName("deleted")
	private String deleted;

	/**
	 * 所属组织
	 */
	@ApiModelProperty(value="所属组织",name="groupId",required=true)
	@FieldName("group_id")
	private String groupId;

	/**
	 * 电话
	 */
	@ApiModelProperty(value=" 电话",name="userPhone",required=true)
	@FieldName("user_phone")
	private String userPhone;

	/**
	 * 备注
	 */
	@ApiModelProperty(value="备注",name="comment",required=true)
	@FieldName("comment")
	private String comment;

	/**
	 * 
	 */
	@ApiModelProperty(value="id",name="id",required=true)
	@Id("id")
	private String id;
}