package top.tqx.demo_1.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import top.tqx.demo_1.common.PageResult;

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

@Data
public class WrongQuestionListResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonProperty("page")
    private PageResult<WrongQuestionItem> page;

    @JsonProperty("stats")
    private WrongQuestionStats stats;

    @Data
    public static class WrongQuestionItem implements Serializable {
        private static final long serialVersionUID = 1L;

        @JsonProperty("answer_id")
        private Long answerId;

        @JsonProperty("question_id")
        private String questionId;

        @JsonProperty("question_type")
        private String questionType;

        @JsonProperty("question_type_name")
        private String questionTypeName;

        @JsonProperty("question_content")
        private Object questionContent;

        @JsonProperty("user_answer")
        private Object userAnswer;

        @JsonProperty("correct_answer")
        private Object correctAnswer;

        @JsonProperty("score")
        private BigDecimal score;

        @JsonProperty("max_score")
        private BigDecimal maxScore;

        @JsonProperty("difficulty")
        private Integer difficulty;

        @JsonProperty("feedback")
        private String feedback;

        @JsonProperty("document_name")
        private String documentName;

        @JsonProperty("knowledge_base_path")
        private String knowledgeBasePath;

        @JsonProperty("tags")
        private List<String> tags;

        @JsonProperty("is_collected")
        private Boolean isCollected;

        @JsonProperty("wrong_count")
        private Integer wrongCount;

        @JsonProperty("answered_at")
        private LocalDateTime answeredAt;
    }

    @Data
    public static class WrongQuestionStats implements Serializable {
        private static final long serialVersionUID = 1L;

        @JsonProperty("total_wrong_count")
        private Integer totalWrongCount;

        @JsonProperty("single_choice_count")
        private Integer singleChoiceCount;

        @JsonProperty("multiple_choice_count")
        private Integer multipleChoiceCount;

        @JsonProperty("true_false_count")
        private Integer trueFalseCount;

        @JsonProperty("fill_blank_count")
        private Integer fillBlankCount;

        @JsonProperty("subjective_count")
        private Integer subjectiveCount;

        @JsonProperty("collected_count")
        private Integer collectedCount;
    }
}
