package com.lesingle.modules.sys.entity;

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

import java.time.LocalDate;

/**
 * 用户实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_sys_user")
@Schema(description = "系统用户实体")
public class SysUser extends BaseEntity {

    @Schema(description = "租户ID")
    @TableField("tenant_id")
    private Long tenantId;

    @Schema(description = "用户名（租户内唯一）")
    private String username;

    @Schema(description = "密码（加密存储）")
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "手机号（租户内唯一）")
    private String phone;

    @Schema(description = "微信OpenID")
    @TableField("wx_openid")
    private String wxOpenid;

    @Schema(description = "微信UnionID")
    @TableField("wx_unionid")
    private String wxUnionid;

    @Schema(description = "用户来源", allowableValues = {"admin_created", "self_registered", "child_migrated"})
    @TableField("user_source")
    private String userSource;

    @Schema(description = "用户类型", allowableValues = {"adult", "child"})
    @TableField("user_type")
    private String userType;

    @Schema(description = "所在城市")
    private String city;

    @Schema(description = "出生日期")
    private LocalDate birthday;

    @Schema(description = "性别")
    private String gender;

    @Schema(description = "头像URL")
    private String avatar;

    @Schema(description = "所属单位")
    private String organization;

    @Schema(description = "账号状态", allowableValues = {"enabled", "disabled"})
    private String status;
}
