DingXiaoYu 3 سال پیش
والد
کامیت
d3109ce3c2

+ 5 - 0
java_compile/src/main/java/com/example/controller/ConfigController.java

@@ -100,6 +100,11 @@ public class ConfigController {
         }
     }
 
+    /**
+     *
+     * @param configId
+     * @return
+     */
     @GetMapping(value = "/delete")
     public Response deleteModelByConfigId(@RequestParam(value = "configId", required = false) String configId) {
         try {

+ 35 - 24
java_compile/src/main/java/com/example/controller/FileController.java

@@ -20,8 +20,11 @@ import org.springframework.web.multipart.MultipartFile;
 @RestController
 @RequestMapping("/api/file")
 public class FileController {
-    @Autowired private   FileService fileService;
+
+    @Autowired private FileService fileService;
+
     @Autowired private CsvAdapter csvAdapter;
+
     /**
      *
      * @param file
@@ -39,6 +42,14 @@ public class FileController {
             return new ErrorRes();
         }
     }
+
+    /**
+     *
+     * @param userId
+     * @param fileLoc
+     * @param fileName
+     * @return
+     */
     @GetMapping(value = "/upload/bigfile")
     public Response bigFileUploader(@RequestParam(value="userId", required = false) String userId,
                                     @RequestParam(value="fileLoc", required = false) String fileLoc,
@@ -53,16 +64,26 @@ public class FileController {
         }
     }
 
+    /**
+     *
+     * @param userId
+     * @return
+     */
     @GetMapping(value = "/get/all")
     public Response getAll(@RequestParam(value="userId", required = false) String userId) {
         try {
-            System.out.println(userId);
             return new NormalRes(fileService.getAllFiles(Integer.parseInt(userId)));
         } catch (Exception e) {
             log.info("error getAll");
             return new ErrorRes();
         }
     }
+
+    /**
+     *
+     * @param userId
+     * @return
+     */
     @GetMapping(value = "/get/allfileandfunc")
     public Response getAllFileAndFunc(@RequestParam(value="userId", required = false)String userId){
         try {
@@ -74,7 +95,11 @@ public class FileController {
         }
     }
 
-
+    /**
+     *
+     * @param fileId
+     * @return
+     */
     @GetMapping(value = "/get/detail")
     public Response getDetail(@RequestParam(value="fileId", required = false) String fileId){
         try{
@@ -84,6 +109,12 @@ public class FileController {
             return new ErrorRes();
         }
     }
+
+    /**
+     *
+     * @param fileId
+     * @return
+     */
     @GetMapping(value = "/analysis")
     public Response analysis(@RequestParam(value="fileId", required = false) String fileId){
         try{
@@ -127,23 +158,6 @@ public class FileController {
         }
     }
 
-
-    ///**
-    // *
-    // * @param nums
-    // * @return
-    // */
-    //@GetMapping(value = "/analysis/test")
-    //public Response analysis2(@RequestParam(value="nums", required = false) int nums){
-    //    try{
-    //        fileService.analysisTest(nums);
-    //        return new NormalRes();
-    //    } catch (Exception e){
-    //        log.info("error analysis2");
-    //        return new ErrorRes();
-    //    }
-    //}
-
     /**
      *
      * @param fileId
@@ -165,9 +179,7 @@ public class FileController {
      * @return
      */
     @PostMapping(value = "update")
-    public Response updateFileInfo(
-            @RequestBody HeaderInfoUpdatedPojo headerInfoUpdatedPojo
-    ) {
+    public Response updateFileInfo(@RequestBody HeaderInfoUpdatedPojo headerInfoUpdatedPojo){
         try {
             boolean rsl = fileService.updateAllHeaders(headerInfoUpdatedPojo.getHeaderInfo(),headerInfoUpdatedPojo.getHeaderNeedUpdate());
             return rsl? new NormalRes() : new ErrorRes(40002, "Server error.");
@@ -175,6 +187,5 @@ public class FileController {
             log.info("error updateFileInfo");
             return new ErrorRes();
         }
-
     }
 }

+ 6 - 0
java_compile/src/main/java/com/example/controller/LoginController.java

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/userManage")
 public class LoginController {
     @Autowired private LoginService loginService;
+
     /**
      *
      * @param username
@@ -43,6 +44,11 @@ public class LoginController {
         }
     }
 
+    /**
+     *
+     * @param user
+     * @return
+     */
     @PostMapping(value = "/register")
     public Response register(@RequestBody User user){     //注册,先判断该用户名是否已经存在
         boolean res=loginService.addUser(user);

+ 37 - 4
java_compile/src/main/java/com/example/controller/ModelController.java

@@ -8,8 +8,8 @@ import com.example.controller.vo.DLModelVO;
 import com.example.controller.vo.ModelVO;
 import com.example.services.FileService;
 import com.example.services.ModelService;
+import com.example.services.pojo.TestFileValuePojo;
 import lombok.extern.slf4j.Slf4j;
-import lombok.val;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -77,6 +77,11 @@ public class ModelController {
         }
     }
 
+    /**
+     *
+     * @param modelId
+     * @return
+     */
     @GetMapping(value = "/get/detail/dl")
     public Response getDLDetailModel(@RequestParam(value="modelId", required = false) String modelId) {
         try{
@@ -125,6 +130,11 @@ public class ModelController {
         }
     }
 
+    /**
+     *
+     * @param modelTypeName
+     * @return
+     */
     @GetMapping(value = "/get/models")
     public Response getModelType(@RequestParam(value="modelTypeName", required = false) String modelTypeName) {
         try {
@@ -135,6 +145,11 @@ public class ModelController {
         }
     }
 
+    /**
+     *
+     * @param modelId
+     * @return
+     */
     @GetMapping(value="/train")
     public Response trainModel(@RequestParam(value="modelId", required = false) String modelId) {
         try {
@@ -145,6 +160,11 @@ public class ModelController {
         }
     }
 
+    /**
+     *
+     * @param modelId
+     * @return
+     */
     @GetMapping(value="/delete")
     public Response deleteModelByModelId(@RequestParam(value="modelId", required = false) String modelId){
         try {
@@ -155,28 +175,41 @@ public class ModelController {
         }
     }
 
+    /**
+     *
+     * @param userId
+     * @param file
+     * @param filename
+     * @return
+     */
     @PostMapping(value="/use/upload")
     public Response uploadTestFile(@RequestParam(value="userId", required = false) String userId,
                                    @RequestParam(value="file", required = false) MultipartFile file,
                                    @RequestParam(value="fileName") String filename) {
         try {
-            val rsl = fileService.uploadTestFile(Integer.parseInt(userId), file, filename);
+            TestFileValuePojo rsl = fileService.uploadTestFile(Integer.parseInt(userId), file, filename);
             return rsl != null ? new NormalRes(rsl) : new ErrorRes(40002, "Server error.");
         } catch (Exception e) {
             e.printStackTrace();
             return new ErrorRes();
         }
     }
+
+    /**
+     *
+     * @param fileId
+     * @param modelId
+     * @return
+     */
     @GetMapping(value="/use")
     public Response useModel(@RequestParam(value = "fileId", required = false) String fileId,
                              @RequestParam(value = "modelId", required = false) String modelId) {
         try {
-                return new NormalRes(modelService.useModel(Integer.parseInt(fileId), Integer.parseInt(modelId)));
+            return new NormalRes(modelService.useModel(Integer.parseInt(fileId), Integer.parseInt(modelId)));
         } catch (Exception e) {
             e.printStackTrace();
             return new ErrorRes();
         }
     }
 
-
 }

+ 10 - 8
java_compile/src/main/java/com/example/controller/PicController.java

@@ -27,8 +27,7 @@ public class PicController {
     @PostMapping(value = "/upload")
     public Response fileLoader(@RequestParam(value = "userId", required = false) String userId,
                                @RequestParam(value = "file", required = false) MultipartFile file,
-                               @RequestParam(value = "fileName") String filename
-    ) {
+                               @RequestParam(value = "fileName") String filename) {
         try {
             boolean rsl = pictureService.uploadPic(Integer.parseInt(userId), file, filename);
             return rsl ? new NormalRes() : new ErrorRes(40002, "Server error.");
@@ -57,8 +56,7 @@ public class PicController {
      * @return
      */
     @GetMapping(value = "/get/one/proj")
-    public Response getOneProj(
-            @RequestParam(value = "picFileId", required = false) String picFileId) {
+    public Response getOneProj(@RequestParam(value = "picFileId", required = false) String picFileId) {
         try {
             return new NormalRes(pictureService.getOneProj(Integer.parseInt(picFileId)));
         } catch (Exception e) {
@@ -72,8 +70,7 @@ public class PicController {
      * @return
      */
     @GetMapping(value = "/get/pics")
-    public Response getPicInfos(
-            @RequestParam(value = "picTag", required = false) String picTag) {
+    public Response getPicInfos(@RequestParam(value = "picTag", required = false) String picTag) {
         try {
             return new NormalRes(pictureService.getAllPicAddr(Integer.parseInt(picTag)));
         } catch (Exception e) {
@@ -82,6 +79,13 @@ public class PicController {
         }
     }
 
+    /**
+     *
+     * @param picId
+     * @param picCategory
+     * @param picTag
+     * @return
+     */
     @GetMapping(value = "/update/picinfo")
     public Response updateFileInfo(
             @RequestParam(value = "picId", required = false) String picId,
@@ -94,7 +98,5 @@ public class PicController {
             e.printStackTrace();
             return new ErrorRes();
         }
-
     }
-
 }