package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 学生信息
 */
@Data
@TableName("t_student")
@Schema(description = "学生信息")
public class Student {

    @Schema(description = "学生 ID", accessMode = Schema.AccessMode.READ_ONLY)
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "租户 ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String tenantId;

    @Schema(description = "学生姓名", example = "张三", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @Schema(description = "性别", example = "male", allowableValues = {"male", "female"})
    private String gender;

    @Schema(description = "出生日期", example = "2018-01-01")
    private LocalDate birthDate;

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

    @Schema(description = "年级", example = "一年级")
    private String grade;

    @Schema(description = "学号")
    private String studentNo;

    @Schema(description = "阅读水平", example = "初级")
    private String readingLevel;

    @Schema(description = "兴趣爱好")
    private String interests;

    @Schema(description = "备注")
    private String notes;

    @Schema(description = "状态", example = "active", allowableValues = {"active", "inactive"})
    private String status;

    @Schema(description = "班级 ID")
    private String classId;

    @Schema(description = "家长姓名")
    private String parentName;

    @Schema(description = "家长手机号", example = "13800138000")
    private String parentPhone;

    @Schema(description = "阅读次数", example = "10")
    private Integer readingCount;

    @Schema(description = "课时数", example = "20")
    private Integer lessonCount;

    @Schema(description = "创建人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    @Schema(description = "更新人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @Schema(description = "是否删除 0-未删除 1-已删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
