diff --git a/src/main/java/com/kwan/springbootkwan/entity/dto/InterviewQuestionTypeDTO.java b/src/main/java/com/kwan/springbootkwan/entity/dto/InterviewQuestionTypeDTO.java index e996d9aa1ffa0b2d629c7df8b7ca84b01e0a0614..10d7f3dfe6db38ab4e228ca39329d1855871fdad 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/dto/InterviewQuestionTypeDTO.java +++ b/src/main/java/com/kwan/springbootkwan/entity/dto/InterviewQuestionTypeDTO.java @@ -9,8 +9,17 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor public class InterviewQuestionTypeDTO { + /** + * 问题类型编码 + */ private Integer questionType; + /** + * 问题类型名称 + */ private String name; + /** + * 问题类型数量 + */ private Integer typeSize; } diff --git a/src/main/java/com/kwan/springbootkwan/mapper/InterviewQuestionMapper.java b/src/main/java/com/kwan/springbootkwan/mapper/InterviewQuestionMapper.java index c710d6928c62c7b12e51922f952bcc715a51c837..5d3a0df280db4e5c4616c441d790cb0161a5e33d 100644 --- a/src/main/java/com/kwan/springbootkwan/mapper/InterviewQuestionMapper.java +++ b/src/main/java/com/kwan/springbootkwan/mapper/InterviewQuestionMapper.java @@ -3,6 +3,7 @@ package com.kwan.springbootkwan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.kwan.springbootkwan.entity.InterviewQuestion; import com.kwan.springbootkwan.entity.dto.InterviewQuestionTypeDTO; +import org.apache.ibatis.annotations.Param; import java.util.LinkedList; @@ -20,5 +21,12 @@ public interface InterviewQuestionMapper extends BaseMapper { * @return */ LinkedList questionType(); + + /** + * 获取面试题的种类 + * + * @return + */ + LinkedList questionType(@Param("id") String id); } diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/InterviewQuestionServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/InterviewQuestionServiceImpl.java index 23bc9d3e2f154299a64f51542094cad39e5f311b..9de9afb1ff2238711be2fb590cbd853ff99ff0b3 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/InterviewQuestionServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/InterviewQuestionServiceImpl.java @@ -64,6 +64,7 @@ public class InterviewQuestionServiceImpl extends ServiceImpl types = interviewQuestionMapper.questionType(); types.addFirst(new InterviewQuestionTypeDTO(0, "全部", 0)); for (InterviewQuestionTypeDTO interviewQuestionTypeDTO : types) { + //数据库存的是问题类型的编码 interviewQuestionTypeDTO.setName(InterviewQuestionTypeEnum.getNameByCode(interviewQuestionTypeDTO.getQuestionType())); } return types;