From c9d04bc519b73f7fc4841c34e2f15fca9db7aad2 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 31 五月 2024 14:08:30 +0800 Subject: [PATCH] 重构:service、mapper plus化,xml删除多余sql --- src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java b/src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java index a22045c..72a8946 100644 --- a/src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java +++ b/src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java @@ -16,6 +16,7 @@ import com.ycl.jxkg.utils.DateTimeUtil; import com.ycl.jxkg.utils.JsonUtil; import com.ycl.jxkg.vo.student.dashboard.*; +import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -28,7 +29,7 @@ import java.util.List; import java.util.stream.Collectors; - +@RequiredArgsConstructor @Controller("WXStudentDashboardController") @RequestMapping(value = "/api/wx/student/dashboard") @ResponseBody @@ -38,14 +39,6 @@ private final TextContentService textContentService; private final TaskExamService taskExamService; private final TaskExamCustomerAnswerService taskExamCustomerAnswerService; - - @Autowired - public DashboardController(ExamPaperService examPaperService, TextContentService textContentService, TaskExamService taskExamService, TaskExamCustomerAnswerService taskExamCustomerAnswerService) { - this.examPaperService = examPaperService; - this.textContentService = textContentService; - this.taskExamService = taskExamService; - this.taskExamCustomerAnswerService = taskExamCustomerAnswerService; - } @RequestMapping(value = "/index", method = RequestMethod.POST) public Result<IndexVO> index() { @@ -98,12 +91,12 @@ private List<TaskItemPaperVO> getTaskItemPaperVm(Integer tFrameId, TaskExamCustomerAnswer taskExamCustomerAnswers) { - TextContent textContent = textContentService.selectById(tFrameId); + TextContent textContent = textContentService.getById(tFrameId); List<TaskItemObject> paperItems = JsonUtil.toJsonListObject(textContent.getContent(), TaskItemObject.class); List<TaskItemAnswerObject> answerPaperItems = null; if (null != taskExamCustomerAnswers) { - TextContent answerTextContent = textContentService.selectById(taskExamCustomerAnswers.getTextContentId()); + TextContent answerTextContent = textContentService.getById(taskExamCustomerAnswers.getTextContentId()); answerPaperItems = JsonUtil.toJsonListObject(answerTextContent.getContent(), TaskItemAnswerObject.class); } -- Gitblit v1.8.0