package com.loan.system.domain.entity;

import lombok.*;

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

@Entity
@Table(name = "users", indexes = {
        @Index(name = "idx_mobile", columnList = "mobile")
}, uniqueConstraints = {
        @UniqueConstraint(name = "username", columnNames = {"username"})
})
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User extends BaseEntity{
    private static final long serialVersionUID = 24L;

    @Column(name = "openid", length = 128)
    private String openid;

    @Column(name = "username", length = 64)
    private String username;

    @Column(name = "password")
    private String password;

    @Column(name = "real_name", length = 100)
    private String realName;

    @Column(name = "sex", length = 10)
    private String sex;

    @Column(name = "mobile", length = 11)
    private String mobile;

    @Column(name = "role")
    private String role;

    @Column(name = "dept", length = 100)
    private String dept;

    @Column(name = "status")
    private Byte status;

    @Column(name = "created_time")
    private String createTime;

    @Column(name = "updated_time")
    private String updateTime;

    @Column(name = "is_delete")
    private Boolean isDelete;

}