From 01f9ff0f80ba79afcd9f41c3d8887305863f3132 Mon Sep 17 00:00:00 2001 From: alvis Date: Thu, 7 Jan 2021 11:03:11 +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/admin/UploadController.java | 2 -- .../xzs/controller/student/UploadController.java | 2 -- .../xzs/controller/wx/student/AuthController.java | 11 +++++++++-- .../controller/wx/student/DashboardController.java | 12 +++++++++--- .../wx/student/ExamPaperAnswerController.java | 13 +++++++++---- .../controller/wx/student/ExamPaperController.java | 9 +++++++-- .../xzs/controller/wx/student/UserController.java | 13 ++++++++++--- 7 files changed, 44 insertions(+), 18 deletions(-) diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/admin/UploadController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/admin/UploadController.java index 32a4b03..9b09ee3 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/admin/UploadController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/admin/UploadController.java @@ -8,7 +8,6 @@ import com.mindskip.xzs.service.FileUpload; import com.mindskip.xzs.service.UserService; import com.mindskip.xzs.viewmodel.admin.file.UeditorConfigVM; import com.mindskip.xzs.viewmodel.admin.file.UploadResultVM; -import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +22,6 @@ import java.io.InputStream; import java.util.Arrays; -@Slf4j @RequestMapping("/api/admin/upload") @RestController("AdminUploadController") public class UploadController extends BaseApiController { 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 5905da4..b1ce264 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.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -18,7 +17,6 @@ import java.io.IOException; import java.io.InputStream; -@Slf4j @RequestMapping("/api/student/upload") @RestController("StudentUploadController") public class UploadController extends BaseApiController { diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/AuthController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/AuthController.java index 488d42f..067afd1 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/AuthController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/AuthController.java @@ -11,7 +11,7 @@ import com.mindskip.xzs.service.UserTokenService; import com.mindskip.xzs.utility.WxUtil; import com.mindskip.xzs.viewmodel.wx.student.user.BindInfo; import com.mindskip.xzs.domain.User; -import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,6 @@ import javax.validation.constraints.NotBlank; @Controller("WXStudentAuthController") @RequestMapping(value = "/api/wx/student/auth") -@AllArgsConstructor @ResponseBody public class AuthController extends BaseWXApiController { @@ -30,6 +29,14 @@ public class AuthController extends BaseWXApiController { private final UserService userService; private final UserTokenService userTokenService; + @Autowired + public AuthController(SystemConfig systemConfig, AuthenticationService authenticationService, UserService userService, UserTokenService userTokenService) { + this.systemConfig = systemConfig; + this.authenticationService = authenticationService; + this.userService = userService; + this.userTokenService = userTokenService; + } + @RequestMapping(value = "/bind", method = RequestMethod.POST) public RestResponse bind(@Valid BindInfo model) { User user = userService.getUserByUserName(model.getUserName()); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/DashboardController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/DashboardController.java index 481d818..0df434b 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/DashboardController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/DashboardController.java @@ -16,8 +16,7 @@ import com.mindskip.xzs.service.TextContentService; import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.JsonUtil; import com.mindskip.xzs.viewmodel.student.dashboard.*; -import com.mindskip.xzs.viewmodel.student.dashboard.*; -import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -31,7 +30,6 @@ import java.util.stream.Collectors; @Controller("WXStudentDashboardController") @RequestMapping(value = "/api/wx/student/dashboard") -@AllArgsConstructor @ResponseBody public class DashboardController extends BaseWXApiController { @@ -40,6 +38,14 @@ public class DashboardController extends BaseWXApiController { 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 RestResponse index() { IndexVM indexVM = new IndexVM(); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperAnswerController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperAnswerController.java index c4671da..f1b747e 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperAnswerController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperAnswerController.java @@ -13,15 +13,13 @@ import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.ExamUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; -import com.mindskip.xzs.viewmodel.student.exam.*; 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 com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitVM; -import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -34,7 +32,6 @@ import java.util.stream.Collectors; @Controller("WXStudentExamPaperAnswerController") @RequestMapping(value = "/api/wx/student/exampaper/answer") -@AllArgsConstructor @ResponseBody public class ExamPaperAnswerController extends BaseWXApiController { @@ -43,6 +40,14 @@ public class ExamPaperAnswerController extends BaseWXApiController { private final ApplicationEventPublisher eventPublisher; private final ExamPaperService examPaperService; + @Autowired + public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, SubjectService subjectService, ApplicationEventPublisher eventPublisher, ExamPaperService examPaperService) { + this.examPaperAnswerService = examPaperAnswerService; + this.subjectService = subjectService; + this.eventPublisher = eventPublisher; + this.examPaperService = examPaperService; + } + @RequestMapping(value = "/pageList", method = RequestMethod.POST) public RestResponse> pageList(@Valid ExamPaperAnswerPageVM model) { model.setCreateUser(getCurrentUser().getId()); diff --git a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperController.java index 3b0c0f7..37f7df0 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperController.java @@ -12,7 +12,7 @@ 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.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -21,13 +21,18 @@ import javax.validation.Valid; @Controller("WXStudentExamController") @RequestMapping(value = "/api/wx/student/exampaper") -@AllArgsConstructor @ResponseBody public class ExamPaperController extends BaseWXApiController { private final ExamPaperService examPaperService; private final SubjectService subjectService; + @Autowired + public ExamPaperController(ExamPaperService examPaperService, SubjectService subjectService) { + this.examPaperService = examPaperService; + this.subjectService = subjectService; + } + @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/wx/student/UserController.java b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/UserController.java index 81f1e4b..0d47eab 100644 --- a/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/UserController.java +++ b/source/xzs/src/main/java/com/mindskip/xzs/controller/wx/student/UserController.java @@ -17,9 +17,8 @@ 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.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -36,7 +35,6 @@ import java.util.stream.Collectors; */ @Controller("WXStudentUserController") @RequestMapping(value = "/api/wx/student/user") -@AllArgsConstructor @ResponseBody public class UserController extends BaseWXApiController { @@ -46,6 +44,15 @@ public class UserController extends BaseWXApiController { private final AuthenticationService authenticationService; private final ApplicationEventPublisher eventPublisher; + @Autowired + 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();