linyk 2 роки тому
батько
коміт
9006523307

+ 4 - 3
site/src/main/java/com/mooctest/crowd/site/controller/MixDefectController.java

@@ -41,9 +41,10 @@ public class MixDefectController {
     @Autowired
     private CrowdProjectService crowdProjectService;
 
-    @PostMapping("/generate/{taskCode}")
-    public ResponseVO generate(@PathVariable("taskCode") String taskCode) {
-        boolean res = mixDefectService.post(taskCode);
+    @GetMapping("/generate/{taskCode}")
+    @LoginRequired
+    public ResponseVO generate(HttpServletRequest request, @PathVariable("taskCode") String taskCode) {
+        boolean res = mixDefectService.post(RequestUtils.getUserId(request), taskCode);
         return new ResponseVO(res ? ServerCode.SUCCESS : ServerCode.ERROR);
     }