From 856d69ce678173e0a8e165bcb0135037d20b48ee Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 15 十月 2024 11:51:22 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java index f37fa61..84d5eb6 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java @@ -130,6 +130,12 @@ entity.setCreateDate(new Date()); insert(entity); modelMethodService.insertList(dto.getModelMethods(), entity.getId()); + + // 替换环境变量MDK_PKGS下的py文件 + String mdkPkgs = System.getenv("MDK_PKGS"); + String pyFilePath = mdkPkgs + File.separator + entity.getPyModule().replace(".", File.separator) + File.separator + entity.getPyName() + ".pyd"; + FileUtil.mkParentDirs(pyFilePath); + FileUtil.copy(entity.getFilePath(), pyFilePath, true); } @Override @@ -141,6 +147,12 @@ updateById(entity); modelMethodService.deleteModelMethod(entity.getId()); modelMethodService.insertList(dto.getModelMethods(), entity.getId()); + + // 替换环境变量MDK_PKGS下的py文件 + String mdkPkgs = System.getenv("MDK_PKGS"); + String pyFilePath = mdkPkgs + File.separator + entity.getPyModule().replace(".", File.separator) + File.separator + entity.getPyName() + ".pyd"; + FileUtil.mkParentDirs(pyFilePath); + FileUtil.copy(entity.getFilePath(), pyFilePath, true); } @Override -- Gitblit v1.9.3