|
@@ -1,6 +1,5 @@
|
|
|
package com.mooctest.crowd.site.controller;
|
|
|
|
|
|
-import com.mooctest.crowd.domain.domainobject.CrowdTestReport;
|
|
|
import com.mooctest.crowd.domain.exception.BaseException;
|
|
|
import com.mooctest.crowd.site.command.CrowdTestReportCommand;
|
|
|
import com.mooctest.crowd.site.data.dto.ReportDetailsDTO;
|
|
@@ -36,7 +35,7 @@ public class CrowdReportController {
|
|
|
@RequestMapping(value = "/project/{projectCode}/task/{taskCode}/report", method = RequestMethod.POST)
|
|
|
public ReportDetailsDTO createTaskReport(@PathVariable("projectCode") String projectCode,
|
|
|
@PathVariable("taskCode") String taskCode,
|
|
|
- @Validated @RequestBody CrowdTestReportCommand command, BindingResult result){
|
|
|
+ @RequestBody @Validated CrowdTestReportCommand command, BindingResult result){
|
|
|
log.info("projectCode: " + projectCode + ", taskCode: "+taskCode);
|
|
|
if (result.hasErrors())
|
|
|
throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
@@ -47,7 +46,10 @@ public class CrowdReportController {
|
|
|
public ReportDetailsDTO updateTaskReport(@PathVariable("projectCode") String projectCode,
|
|
|
@PathVariable("taskCode") String taskCode,
|
|
|
@PathVariable("reportCode") String reportCode,
|
|
|
- @Validated @RequestBody CrowdTestReportCommand command, BindingResult result){
|
|
|
+ @RequestBody @Validated CrowdTestReportCommand command, BindingResult result){
|
|
|
+ log.info("projectCode: " + projectCode + ", taskCode: "+taskCode);
|
|
|
+ if (result.hasErrors())
|
|
|
+ throw new BaseException(result.getFieldError().getDefaultMessage());
|
|
|
return reportService.updateTaskReport(projectCode, taskCode, reportCode, command);
|
|
|
}
|
|
|
|