package cn.meowrain.aioj.backend.question.dto.resp;

import cn.meowrain.aioj.backend.question.dto.req.JudgeCase;
import cn.meowrain.aioj.backend.question.dto.req.JudgeConfig;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 题目响应 DTO
 * <p>
 * 用于返回给前端的题目详情信息
 * </p>
 */
@Data
@Schema(description = "题目详情响应对象")
public class QuestionResponseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 题目ID
     */
    @Schema(description = "题目ID", example = "1789123456789012345")
    private Long id;

    /**
     * 题目标题
     */
    @Schema(description = "题目标题", example = "A + B 问题")
    private String title;

    /**
     * 题目详细内容/描述
     */
    @Schema(description = "题目详细内容/描述", example = "请输入两个整数 A 和 B，计算它们的和...")
    private String content;

    /**
     * 难度等级：easy/medium/hard
     */
    @Schema(description = "难度等级 (easy/medium/hard)", example = "easy")
    private String difficulty;

    /**
     * 标签列表
     */
    @Schema(description = "标签列表", example = "[\"栈\", \"数组\", \"算法\"]")
    private List<String> tags;

    /**
     * 判题用例列表
     */
    @Schema(description = "判题用例列表")
    private List<JudgeCase> judgeCase;

    /**
     * 通过数
     */
    @Schema(description = "通过数", example = "100")
    private Integer acceptedCount;

    /**
     * 总提交数
     */
    @Schema(description = "总提交数", example = "500")
    private Integer submitCount;

    /**
     * 判题配置
     * 包含 timeLimit, memoryLimit, stackLimit 等
     */
    @Schema(description = "判题配置", example = "{\"timeLimit\": 1000, \"memoryLimit\": 256}")
    private JudgeConfig judgeConfig;

    /**
     * 点赞数
     */
    @Schema(description = "点赞数", example = "20")
    private Integer thumbCount;

    /**
     * 收藏数
     */
    @Schema(description = "收藏数", example = "5")
    private Integer favourCount;

    /**
     * 创建者/出题人 ID
     */
    @Schema(description = "创建者/出题人 ID", example = "123456")
    private Long userId;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间", example = "2024-01-20T12:00:00")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间", example = "2024-01-21T10:30:00")
    private LocalDateTime updateTime;
}