package com.app.entity.platform.system;

import com.app.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 功能描述：账号实体
 *
 * @Auther 梁展鹏
 * @Date 2020/1/18 16:03
 */
@ApiModel("账号实体")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("t_platform_account")
public class Account extends BaseEntity {

    @ApiModelProperty("昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty("用户头像图片的 URL")
    @TableField("avatar_url")
    private String avatarUrl;

    @ApiModelProperty("用户性别（0未知、1男性、2女性）")
    @TableField("gender")
    private Integer gender;

    @ApiModelProperty("类型：1：平台、2：租户管理员、3：普通账号")
    @TableField(value = "type")
    private Integer type;

    @ApiModelProperty(notes = "密码修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "password_failure_date_time")
    private LocalDateTime passwordFailureDateTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull
    @TableField(value = "end_date_time")
    private LocalDateTime endDateTime;

    @ApiModelProperty("是否锁定")
    @TableField(value = "is_locked")
    private Boolean isLocked;

}
