/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package io.renren.modules.app.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;


/**
 * 用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@Data
@TableName("member")
public class UserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 用户ID 会员id (会员表)
	 */
	@TableId(value = "id")
	private Long userId;
	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空", groups = AddGroup.class)
	private String username;
	/**
	 * 密码
	 */
	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	private String password;
	/**
	 * 盐
	 */
	@JsonIgnore
	private String salt;
	/**
	 * 姓名
	 */
	@NotBlank(message="姓名不能为空", groups = UpdateGroup.class)
	private String truename;
	/**
	 * 性别
	 */
	private Integer sex;
	/**
	 * 头像
	 */
	private String titlePic;
	/**
	 * 所属机构(单位名称、公司名称
	 */
	private String organization;
	/**
	 * 职位id
	 */
	private String position;
	/**
	 * 职称
	 */
	private String jobTitle;
	/**
	 * 电话
	 */
	@NotBlank(message="手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String phone;
	/**
	 * 邮箱
	 */
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	private String email;
	/**
	 * 创建时间
	 */
	private Date createTime;
	/**
	 * 创建时间
	 */
	private Date modifyTime;
}
