package com.softwarebr.nunu.entity.user;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 用户
 *
 * @Author lilin
 * @Date 2020-02-17 14:07:07
 */

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "u_member")
@Builder
public class Member {

    /**
     * 禁用
     */
    public final static Integer STATUS_PROHIBIT = 0;

    /**
     * 正常
     */
    public final static Integer STATUS_ENABLE = 1;

    /**
     * PC微信登录
     */
    public final static Integer USER_THIRD_PARTY_PC_WECHAT = 1;

    /**
     * h5微信登录
     */
    public final static Integer USER_THIRD_PARTY_H5_WECHAT = 2;

    /**
     * 身份-用户
     */
    public final static Integer IDENTITY_TYPE_MEMBER = 1;

    /**
     * 身份-企业
     */
    public final static Integer IDENTITY_TYPE_ENTERPRISE = 2;

    /** 注册检查-未注册 */
    public final static Integer MEMBER_CHECK_REGISTER_PASS = 1001;

    /** 注册检查-号码已绑定微信第三方 */
    public final static Integer MEMBER_CHECK_REGISTER_BINDING = 1002;

    /** 注册检查-已注册 */
    public final static Integer MEMBER_CHECK_REGISTER_REJECT = 1003;

    /** 注册检查-已注册未绑定微信第三方*/
    public final static Integer MEMBER_CHECK_REGISTER_BINDING_NO = 1004;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id", required = true, example = "1")
    private Long id;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", required = true, example = "2018-03-12 21:32:33")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "手机号码", required = true, example = "")
    private String phone;

    @ApiModelProperty(value = "密码", required = true, example = "")
    private String password;

    @ApiModelProperty(value = "昵称", required = true, example = "")
    private String nickname;

    @ApiModelProperty(value = "头像", required = true, example = "")
    @Column(length = Integer.MAX_VALUE)
    private String headImgUri;

    @ApiModelProperty(value = "身份(1用户 2企业)", required = true, example = "")
    private Integer identityType;

    @ApiModelProperty(value = "省份", required = true, example = "")
    private String customerName;

    @ApiModelProperty(value = "姓名", required = true, example = "")
    private String username;

    @ApiModelProperty(value = "企业名称", required = true, example = "")
    private String companyName;

    @ApiModelProperty(value = "微信openId", required = true, example = "")
    private String wxOpenId;

    @ApiModelProperty(value = "账号状态(0.禁用1.正常)", required = true, example = "")
    private Integer status;

}