优化
This commit is contained in:
		
							parent
							
								
									4de5327e87
								
							
						
					
					
						commit
						01f9ff0f80
					
				@ -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 {
 | 
			
		||||
 | 
			
		||||
@ -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 {
 | 
			
		||||
 | 
			
		||||
@ -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());
 | 
			
		||||
 | 
			
		||||
@ -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<IndexVM> index() {
 | 
			
		||||
        IndexVM indexVM = new IndexVM();
 | 
			
		||||
 | 
			
		||||
@ -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<PageInfo<ExamPaperAnswerPageResponseVM>> pageList(@Valid ExamPaperAnswerPageVM model) {
 | 
			
		||||
        model.setCreateUser(getCurrentUser().getId());
 | 
			
		||||
 | 
			
		||||
@ -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<ExamPaperEditRequestVM> select(@PathVariable Integer id) {
 | 
			
		||||
 | 
			
		||||
@ -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<UserResponseVM> current() {
 | 
			
		||||
        User user = getCurrentUser();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user