package com.mindskip.xzs.vo; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentStyle; import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; import com.alibaba.excel.enums.poi.VerticalAlignmentEnum; import com.mindskip.xzs.domain.vo.QuestionSubjectVO; import lombok.Data; import org.springframework.util.StringUtils; import java.util.List; /** * @author:xp * @date:2024/3/15 17:06 */ @Data @ColumnWidth(20) @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)//内容样式 public class QuestionImportVO { @ExcelProperty("题目类型") private String questionType; @ExcelProperty("课目(多个用、隔开)") private String subjectName; @ExcelIgnore private List subjectIds; @ExcelIgnore private List subjectList; @ColumnWidth(80) @ExcelProperty("题干") private String title; /*** * 题目内容 */ @ExcelIgnore private String questionContent; // 选项内容 @ExcelProperty({"题目选项", "选项"}) private String optionName; @ExcelProperty({"题目选项", "选项值"}) private String optionValue; @ExcelProperty("答案(多个用、隔开)") private String correct; // 解析 @ColumnWidth(30) @ExcelProperty("解析") private String analyze; // 题目分数 @ExcelProperty("题目分数") private Integer score; // 题目难度 @ExcelProperty("题目难度") private Integer difficult; /** * 返回该条数据是不是题,因为还有选项。选项的这些值是空的 * @return */ public boolean master() { return StringUtils.hasText(questionType) && StringUtils.hasText(subjectName) && StringUtils.hasText(title); } }