package com.test.bijihoudaun.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(name = "用户实体")
@TableName("`user`")
public class User {
    @Schema(description = "用户id",implementation = Long.class)
    @TableId(type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    
    @Schema(description = "用户名",implementation = String.class)
    @TableField("`username`")
    private String username;
    
    @Schema(description = "密码",implementation = String.class)
    @TableField("`password`")
    private String password;
    
    @Schema(description = "邮箱",implementation = String.class)
    @TableField("`email`")
    private String email;
    
    @Schema(description = "用户角色(ADMIN-管理员,USER-普通用户)",implementation = String.class)
    @TableField("`role`")
    private String role;
    
    @Schema(description = "用户创建时间",implementation = Date.class)
    @TableField("created_at")
    private Date createdAt;
    
    @Schema(description = "用户更新时间",implementation = Date.class)
    @TableField("updated_at")
    private Date updatedAt;
    
    @Schema(description = "用户token",implementation = String.class)
    @TableField("`token`")
    private String token;
    
    @Schema(description = "用户token过期时间",implementation = Date.class)
    @TableField("token_enddata")
    private Date tokenEnddata;
}
