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/student/DashboardController.java |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java b/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java
index 2b38b38..320fb1d 100644
--- a/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java
+++ b/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java
@@ -13,6 +13,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.web.bind.annotation.RequestMapping;
@@ -24,6 +25,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+@RequiredArgsConstructor
 @RestController("StudentDashboardController")
 @RequestMapping(value = "/api/student/dashboard")
 public class DashboardController extends BaseApiController {
@@ -34,16 +36,6 @@
     private final TaskExamService taskExamService;
     private final TaskExamCustomerAnswerService taskExamCustomerAnswerService;
     private final TextContentService textContentService;
-
-    @Autowired
-    public DashboardController(UserService userService, ExamPaperService examPaperService, QuestionService questionService, TaskExamService taskExamService, TaskExamCustomerAnswerService taskExamCustomerAnswerService, TextContentService textContentService) {
-        this.userService = userService;
-        this.examPaperService = examPaperService;
-        this.questionService = questionService;
-        this.taskExamService = taskExamService;
-        this.taskExamCustomerAnswerService = taskExamCustomerAnswerService;
-        this.textContentService = textContentService;
-    }
 
     @RequestMapping(value = "/index", method = RequestMethod.POST)
     public Result<IndexVO> index() {
@@ -97,12 +89,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