From 013788bb3c3ec6c11274292a3af8957d4e8d1772 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 31 五月 2024 14:51:09 +0800 Subject: [PATCH] 实体类调整 --- src/main/java/com/ycl/jxkg/controller/student/QuestionAnswerController.java | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/controller/student/QuestionAnswerController.java b/src/main/java/com/ycl/jxkg/controller/student/QuestionAnswerController.java index 755d6c1..8e9996f 100644 --- a/src/main/java/com/ycl/jxkg/controller/student/QuestionAnswerController.java +++ b/src/main/java/com/ycl/jxkg/controller/student/QuestionAnswerController.java @@ -2,9 +2,9 @@ import com.ycl.jxkg.base.BaseApiController; import com.ycl.jxkg.base.Result; -import com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer; -import com.ycl.jxkg.domain.Subject; -import com.ycl.jxkg.domain.TextContent; +import com.ycl.jxkg.domain.entity.ExamPaperQuestionCustomerAnswer; +import com.ycl.jxkg.domain.entity.Subject; +import com.ycl.jxkg.domain.entity.TextContent; import com.ycl.jxkg.domain.question.QuestionObject; import com.ycl.jxkg.service.ExamPaperQuestionCustomerAnswerService; import com.ycl.jxkg.service.QuestionService; @@ -20,10 +20,11 @@ import com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentRequestVO; import com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentResponseVO; import com.github.pagehelper.PageInfo; +import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +@RequiredArgsConstructor @RestController("StudentQuestionAnswerController") @RequestMapping(value = "/api/student/question/answer") public class QuestionAnswerController extends BaseApiController { @@ -33,24 +34,16 @@ private final TextContentService textContentService; private final SubjectService subjectService; - @Autowired - public QuestionAnswerController(ExamPaperQuestionCustomerAnswerService examPaperQuestionCustomerAnswerService, QuestionService questionService, TextContentService textContentService, SubjectService subjectService) { - this.examPaperQuestionCustomerAnswerService = examPaperQuestionCustomerAnswerService; - this.questionService = questionService; - this.textContentService = textContentService; - this.subjectService = subjectService; - } - @RequestMapping(value = "/page", method = RequestMethod.POST) public Result<PageInfo<QuestionPageStudentResponseVO>> pageList(@RequestBody QuestionPageStudentRequestVO model) { model.setCreateUser(getCurrentUser().getId()); PageInfo<ExamPaperQuestionCustomerAnswer> pageInfo = examPaperQuestionCustomerAnswerService.studentPage(model); PageInfo<QuestionPageStudentResponseVO> page = PageInfoHelper.copyMap(pageInfo, q -> { - Subject subject = subjectService.selectById(q.getSubjectId()); + Subject subject = subjectService.getById(q.getSubjectId()); QuestionPageStudentResponseVO vo = new QuestionPageStudentResponseVO(); BeanUtils.copyProperties(q, vo); vo.setCreateTime(DateTimeUtil.dateFormat(q.getCreateTime())); - TextContent textContent = textContentService.selectById(q.getQuestionTextContentId()); + TextContent textContent = textContentService.getById(q.getQuestionTextContentId()); QuestionObject questionObject = JsonUtil.toJsonObject(textContent.getContent(), QuestionObject.class); String clearHtml = HtmlUtil.clear(questionObject.getTitleContent()); vo.setShortTitle(clearHtml); @@ -64,7 +57,7 @@ @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public Result<QuestionAnswerVO> select(@PathVariable Integer id) { QuestionAnswerVO vm = new QuestionAnswerVO(); - ExamPaperQuestionCustomerAnswer examPaperQuestionCustomerAnswer = examPaperQuestionCustomerAnswerService.selectById(id); + ExamPaperQuestionCustomerAnswer examPaperQuestionCustomerAnswer = examPaperQuestionCustomerAnswerService.getById(id); ExamPaperSubmitItemVO questionAnswerVM = examPaperQuestionCustomerAnswerService.examPaperQuestionCustomerAnswerToVM(examPaperQuestionCustomerAnswer); QuestionEditRequestVO questionVM = questionService.getQuestionEditRequestVM(examPaperQuestionCustomerAnswer.getQuestionId()); vm.setQuestionVM(questionVM); -- Gitblit v1.8.0