From a874b928e16320839315b9abcdf2cece1229a424 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期四, 07 十一月 2024 09:20:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java
index 180c168..74f7a1b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java
@@ -4,6 +4,7 @@
 import com.iailab.framework.common.pojo.CommonResult;
 import com.iailab.module.model.mpk.dto.MpkFileDTO;
 import com.iailab.module.model.mpk.service.MpkFileService;
+import com.iailab.module.model.mpk.service.PackService;
 import io.swagger.v3.oas.annotations.Operation;
 import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +30,9 @@
 public class MpkFileController {
     @Autowired
     private MpkFileService mpkFileService;
+
+    @Autowired
+    private PackService packService;
 
     @GetMapping("page")
     @Operation(summary = "分页")
@@ -66,6 +70,7 @@
                 dto.setGroupName(dto.getMenuAndGroup().get(1));
             }
         }
+        dto.setPyModule(packService.getModelPath(dto.getClassName()));
         mpkFileService.save(dto);
         return CommonResult.success(true);
     }
@@ -86,6 +91,7 @@
                 dto.setGroupName(dto.getMenuAndGroup().get(1));
             }
         }
+        dto.setPyModule(packService.getModelPath(dto.getClassName()));
         mpkFileService.update(dto);
         return CommonResult.success(true);
     }
@@ -102,7 +108,7 @@
 
             IOUtils.write(data, response.getOutputStream());
         } catch (Exception e) {
-            throw new RuntimeException("代码生成异常");
+            throw new RuntimeException("代码生成异常",e);
         }
     }
 
@@ -125,8 +131,13 @@
 
     @PostMapping("/upload")
     @Operation(summary = "python文件上传")
-    public CommonResult<Map<String,String>> importExcel(@RequestParam("file") MultipartFile file) throws Exception {
+    public CommonResult<Map<String,String>> upload(@RequestParam("file") MultipartFile file) throws Exception {
         Map<String,String> result = mpkFileService.savePyFile(file);
         return success(result);
     }
+
+    @PostMapping("/publish")
+    public CommonResult<String> publish(@RequestBody Map<String, Object> params) {
+        return mpkFileService.publish(params);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3