package top.continew.admin.business.model.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import top.continew.admin.business.enums.AssignmentsTypeEnum;
import top.continew.starter.extension.crud.model.req.BaseReq;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 创建或修改作业表信息
 *
 * @author 张波
 * @since 2024/10/22 11:45
 */
@Data
@Schema(description = "创建或修改作业表信息")
public class AssignmentsReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 课程表ID
     */
    @Schema(description = "课程表ID")
    @NotNull(message = "课程表ID不能为空")
    private Long courseId;

    /**
     * 分类(1:作业，2:考试)
     */
    @Schema(description = "类型", example = "1")
    @NotNull(message = "类型不能为空")
    private AssignmentsTypeEnum type;

    /**
     * 作业名称
     */
    @Schema(description = "作业名称")
    @NotBlank(message = "作业名称不能为空")
    @Length(max = 255, message = "作业名称长度不能超过 {max} 个字符")
    private String name;

    /**
     * 作业要求
     */
    @Schema(description = "作业要求")
    @Length(max = 255, message = "作业名称长度不能超过 {max} 个字符")
    private String requirements;

    /**
     * 满分
     */
    @Schema(description = "满分", example = "100")
    @Max(value = 200, message = "满分不能超过200")
    private Integer fullScore;

    /**
     * 开始时间
     */
    @Schema(description = "开始时间")
    @NotNull(message = "开始时间不能为空")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @Schema(description = "结束时间")
    @NotNull(message = "结束时间不能为空")
    private LocalDateTime endTime;

    /**
     * 示例图片
     */
    private String exampleImages;
}