From 8546b3d285af4235a0ef615a0c6e89486ae2c806 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 17 十月 2024 21:01:37 +0800 Subject: [PATCH] 达梦不支持value改为values --- src/main/java/com/ycl/jxkg/controller/student/DashboardController.java | 31 +++++++++++-------------------- 1 files changed, 11 insertions(+), 20 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..eb9fa82 100644 --- a/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java +++ b/src/main/java/com/ycl/jxkg/controller/student/DashboardController.java @@ -2,19 +2,19 @@ import com.ycl.jxkg.base.BaseApiController; import com.ycl.jxkg.base.Result; -import com.ycl.jxkg.domain.TaskExam; -import com.ycl.jxkg.domain.TaskExamCustomerAnswer; -import com.ycl.jxkg.domain.TextContent; -import com.ycl.jxkg.domain.User; -import com.ycl.jxkg.domain.enums.ExamPaperTypeEnum; +import com.ycl.jxkg.domain.entity.TaskExam; +import com.ycl.jxkg.domain.entity.TaskExamCustomerAnswer; +import com.ycl.jxkg.domain.entity.TextContent; +import com.ycl.jxkg.domain.entity.User; +import com.ycl.jxkg.enums.ExamPaperTypeEnum; import com.ycl.jxkg.domain.task.TaskItemAnswerObject; import com.ycl.jxkg.domain.task.TaskItemObject; import com.ycl.jxkg.service.*; import com.ycl.jxkg.utils.DateTimeUtil; import com.ycl.jxkg.utils.JsonUtil; -import com.ycl.jxkg.vo.student.dashboard.*; +import com.ycl.jxkg.domain.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; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -24,6 +24,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 +35,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() { @@ -58,7 +49,7 @@ PaperFilter timeLimitPaperFilter = new PaperFilter(); timeLimitPaperFilter.setDateTime(new Date()); timeLimitPaperFilter.setGradeLevel(user.getUserLevel()); - timeLimitPaperFilter.setExamPaperType(ExamPaperTypeEnum.TimeLimit.getCode()); + timeLimitPaperFilter.setExamPaperType(ExamPaperTypeEnum.Random.getCode()); List<PaperInfo> limitPaper = examPaperService.indexPaper(timeLimitPaperFilter); List<PaperInfoVO> paperInfoVOS = limitPaper.stream().map(d -> { @@ -97,12 +88,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