From 75ffa05d65ed3ebe76904f1c35b1191e10424bd9 Mon Sep 17 00:00:00 2001 From: alvis Date: Tue, 5 Jan 2021 10:20:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xzs/controller/student/DashboardController.java | 13 +++++++++---- .../xzs/controller/student/EducationController.java | 6 ++++-- .../student/ExamPaperAnswerController.java | 10 +++++++--- .../xzs/controller/student/ExamPaperController.java | 8 ++++++-- .../student/QuestionAnswerController.java | 9 +++++++-- .../xzs/controller/student/QuestionController.java | 5 +++-- .../xzs/controller/student/UploadController.java | 7 +++++-- .../xzs/controller/student/UserController.java | 11 ++++++++--- 8 files changed, 49 insertions(+), 20 deletions(-) diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/DashboardController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/DashboardController.java index 49856df..6034223 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/DashboardController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/DashboardController.java @@ -13,9 +13,6 @@ import com.mindskip.xzs.service.*; import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.JsonUtil; import com.mindskip.xzs.viewmodel.student.dashboard.*; -import com.mindskip.xzs.service.*; -import com.mindskip.xzs.viewmodel.student.dashboard.*; -import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -27,7 +24,6 @@ import java.util.stream.Collectors; @RestController("StudentDashboardController") @RequestMapping(value = "/api/student/dashboard") -@AllArgsConstructor public class DashboardController extends BaseApiController { private final UserService userService; @@ -37,6 +33,15 @@ public class DashboardController extends BaseApiController { private final TaskExamCustomerAnswerService taskExamCustomerAnswerService; private final TextContentService textContentService; + 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 RestResponse index() { IndexVM indexVM = new IndexVM(); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/EducationController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/EducationController.java index 781141d..32e7beb 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/EducationController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/EducationController.java @@ -8,7 +8,6 @@ import com.mindskip.xzs.domain.User; import com.mindskip.xzs.service.SubjectService; import com.mindskip.xzs.viewmodel.student.education.SubjectEditRequestVM; import com.mindskip.xzs.viewmodel.student.education.SubjectVM; -import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -16,11 +15,14 @@ import java.util.stream.Collectors; @RestController("StudentEducationController") @RequestMapping(value = "/api/student/education") -@AllArgsConstructor public class EducationController extends BaseApiController { private final SubjectService subjectService; + public EducationController(SubjectService subjectService) { + this.subjectService = subjectService; + } + @RequestMapping(value = "/subject/list", method = RequestMethod.POST) public RestResponse> list() { User user = getCurrentUser(); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java index b7ea207..9707e59 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java @@ -18,8 +18,6 @@ import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitVM; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM; import com.github.pagehelper.PageInfo; -import com.mindskip.xzs.domain.*; -import lombok.AllArgsConstructor; import org.springframework.context.ApplicationEventPublisher; import org.springframework.web.bind.annotation.*; @@ -28,7 +26,6 @@ import java.util.Date; @RestController("StudentExamPaperAnswerController") @RequestMapping(value = "/api/student/exampaper/answer") -@AllArgsConstructor public class ExamPaperAnswerController extends BaseApiController { private final ExamPaperAnswerService examPaperAnswerService; @@ -36,6 +33,13 @@ public class ExamPaperAnswerController extends BaseApiController { private final SubjectService subjectService; private final ApplicationEventPublisher eventPublisher; + public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, ExamPaperService examPaperService, SubjectService subjectService, ApplicationEventPublisher eventPublisher) { + this.examPaperAnswerService = examPaperAnswerService; + this.examPaperService = examPaperService; + this.subjectService = subjectService; + this.eventPublisher = eventPublisher; + } + @RequestMapping(value = "/pageList", method = RequestMethod.POST) public RestResponse> pageList(@RequestBody @Valid ExamPaperAnswerPageVM model) { diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperController.java index 061b284..b813796 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/ExamPaperController.java @@ -11,7 +11,6 @@ import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageResponseVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM; import com.github.pagehelper.PageInfo; -import lombok.AllArgsConstructor; import org.springframework.context.ApplicationEventPublisher; import org.springframework.web.bind.annotation.*; @@ -19,13 +18,18 @@ import javax.validation.Valid; @RestController("StudentExamPaperController") @RequestMapping(value = "/api/student/exam/paper") -@AllArgsConstructor public class ExamPaperController extends BaseApiController { private final ExamPaperService examPaperService; private final ExamPaperAnswerService examPaperAnswerService; private final ApplicationEventPublisher eventPublisher; + public ExamPaperController(ExamPaperService examPaperService, ExamPaperAnswerService examPaperAnswerService, ApplicationEventPublisher eventPublisher) { + this.examPaperService = examPaperService; + this.examPaperAnswerService = examPaperAnswerService; + this.eventPublisher = eventPublisher; + } + @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse select(@PathVariable Integer id) { diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionAnswerController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionAnswerController.java index 12461e8..fa4cbf4 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionAnswerController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionAnswerController.java @@ -20,12 +20,10 @@ import com.mindskip.xzs.viewmodel.student.question.answer.QuestionAnswerVM; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM; import com.github.pagehelper.PageInfo; -import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; @RestController("StudentQuestionAnswerController") @RequestMapping(value = "/api/student/question/answer") -@AllArgsConstructor public class QuestionAnswerController extends BaseApiController { private final ExamPaperQuestionCustomerAnswerService examPaperQuestionCustomerAnswerService; @@ -33,6 +31,13 @@ public class QuestionAnswerController extends BaseApiController { private final TextContentService textContentService; private final SubjectService subjectService; + 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 RestResponse> pageList(@RequestBody QuestionPageStudentRequestVM model) { model.setCreateUser(getCurrentUser().getId()); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionController.java index 2171644..31bd9a0 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/QuestionController.java @@ -2,15 +2,16 @@ package com.mindskip.xzs.controller.student; import com.mindskip.xzs.base.BaseApiController; import com.mindskip.xzs.service.QuestionService; -import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; @RestController("StudentQuestionController") @RequestMapping(value = "/api/student/question") -@AllArgsConstructor public class QuestionController extends BaseApiController { private final QuestionService questionService; + public QuestionController(QuestionService questionService) { + this.questionService = questionService; + } } diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UploadController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UploadController.java index 37af73a..dce24b0 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UploadController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UploadController.java @@ -5,7 +5,6 @@ import com.mindskip.xzs.base.BaseApiController; import com.mindskip.xzs.base.RestResponse; import com.mindskip.xzs.service.FileUpload; import com.mindskip.xzs.service.UserService; -import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -19,7 +18,6 @@ import java.io.InputStream; @Slf4j -@AllArgsConstructor @RequestMapping("/api/student/upload") @RestController("StudentUploadController") public class UploadController extends BaseApiController { @@ -27,6 +25,11 @@ public class UploadController extends BaseApiController { private final FileUpload fileUpload; private final UserService userService; + public UploadController(FileUpload fileUpload, UserService userService) { + this.fileUpload = fileUpload; + this.userService = userService; + } + @RequestMapping("/image") @ResponseBody diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UserController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UserController.java index d8671b9..99f1075 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UserController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/student/UserController.java @@ -17,8 +17,6 @@ import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.student.user.*; import com.github.pagehelper.PageInfo; -import com.mindskip.xzs.viewmodel.student.user.*; -import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.context.ApplicationEventPublisher; import org.springframework.web.bind.annotation.*; @@ -35,7 +33,6 @@ import java.util.stream.Collectors; */ @RestController("StudentUserController") @RequestMapping(value = "/api/student/user") -@AllArgsConstructor public class UserController extends BaseApiController { private final UserService userService; @@ -44,6 +41,14 @@ public class UserController extends BaseApiController { private final AuthenticationService authenticationService; private final ApplicationEventPublisher eventPublisher; + public UserController(UserService userService, UserEventLogService userEventLogService, MessageService messageService, AuthenticationService authenticationService, ApplicationEventPublisher eventPublisher) { + this.userService = userService; + this.userEventLogService = userEventLogService; + this.messageService = messageService; + this.authenticationService = authenticationService; + this.eventPublisher = eventPublisher; + } + @RequestMapping(value = "/current", method = RequestMethod.POST) public RestResponse current() { User user = getCurrentUser();