Forráskód Böngészése

change the annotation

Miaomz 6 éve
szülő
commit
584cdb597f

+ 2 - 5
src/main/java/com/moekr/moocoder/web/ProjectController.java

@@ -4,10 +4,7 @@ import com.moekr.moocoder.logic.service.ProjectService;
 import com.moekr.moocoder.web.dto.CodeDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 /**
@@ -30,7 +27,7 @@ public class ProjectController {
     }
 
     @PostMapping("/upload_file")
-    public @ResponseBody String uploadProject(@RequestParam CodeDTO codeDTO) {
+    public @ResponseBody String uploadProject(@RequestBody CodeDTO codeDTO) {
         return projectService.addProject(codeDTO);
     }
 }