From 066e3f58991bdf50d8b69bbd9a782051ebad729f Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Wed, 1 Jul 2026 11:32:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BC=96=E8=BE=91=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=8F=AA=E4=BF=9D=E5=AD=98=E6=9C=AC=E5=9C=B0=EF=BC=8C?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87=E6=97=B6=E6=89=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=88=B0=E4=B8=83=E7=89=9B=E4=BA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/par/api/controller/AdminController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/par-api/src/main/java/com/par/api/controller/AdminController.java b/par-api/src/main/java/com/par/api/controller/AdminController.java index 150e363..0d5ebac 100644 --- a/par-api/src/main/java/com/par/api/controller/AdminController.java +++ b/par-api/src/main/java/com/par/api/controller/AdminController.java @@ -45,6 +45,7 @@ public class AdminController { private final PskService pskService; private final ConfigService configService; private final CachedStorageService storageService; + private final com.par.core.storage.LocalStorageService localStorageService; private final com.par.core.service.SiteService siteService; /** @@ -264,14 +265,14 @@ public class AdminController { if (scriptPath == null || scriptPath.isBlank()) { String hash = config.getConfigHash() != null ? config.getConfigHash().substring(0, 8) : Long.toHexString(System.currentTimeMillis()); - scriptPath = String.format("configs/%s/%s/%s.groovy", config.getSiteId(), - config.getStatus() == ConfigStatus.PENDING ? "pending" : "approved", hash); + scriptPath = String.format("configs/%s/pending/%s.groovy", config.getSiteId(), hash); config.setScriptStoragePath(scriptPath); } - storageService.store(scriptPath, script); + // 只保存到本地,审批通过时才同步到七牛云 + localStorageService.store(scriptPath, script); siteConfigMapper.updateById(config); - log.info("Config script updated: id={}, siteId={}", configId, config.getSiteId()); + log.info("Config script saved locally: id={}, siteId={}", configId, config.getSiteId()); return ApiResponse.success(configService.toDTO(config)); }