From 153f2aa938b152e649249565e7b4f9da1f30a687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Thu, 21 Sep 2023 17:47:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AF=81=E6=98=8Emapper=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=98=AF=E5=8F=AF=E4=BB=A5=E8=A2=AB=E9=87=8D?= =?UTF-8?q?=E5=86=99=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/dto/InterviewQuestionTypeDTO.java | 9 +++++++++ .../springbootkwan/mapper/InterviewQuestionMapper.java | 8 ++++++++ .../service/impl/InterviewQuestionServiceImpl.java | 1 + 3 files changed, 18 insertions(+) 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 e996d9a..10d7f3d 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 c710d69..5d3a0df 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 23bc9d3..9de9afb 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; -- GitLab