package com.lingyue.auth.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lingyue.common.domain.entity.SimpleModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 用户实体
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("users")
@Schema(description = "用户实体")
public class User extends SimpleModel {
    
    @Schema(description = "用户名")
    @TableField("username")
    private String username;
    
    @Schema(description = "邮箱")
    @TableField("email")
    private String email;
    
    @Schema(description = "密码哈希")
    @TableField("password_hash")
    private String passwordHash;
    
    @Schema(description = "头像URL")
    @TableField("avatar_url")
    private String avatarUrl;
    
    @Schema(description = "角色")
    @TableField("role")
    private String role = "user"; // admin/user/guest
    
    @Schema(description = "偏好设置(JSON字符串)")
    @TableField("preferences")
    private String preferences;
    
    @Schema(description = "最后登录时间")
    @TableField("last_login_at")
    private Date lastLoginAt;
}
