refactor: 文件路径按pending/approved区分,去掉版本号

- submit: configs/{siteId}/pending/{hash}.json
- approve: 文件移到 configs/{siteId}/approved/{hash}.json
This commit is contained in:
mediabot-pt
2026-06-29 23:20:14 +08:00
parent d093c5eb28
commit 7d7de75bbd
2 changed files with 11 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ public class ConfigServiceImpl implements ConfigService {
public SiteConfig submitConfig(String siteId, String version, String configJson,
String schemaVersion, Long submitterId) {
String configHash = HmacUtil.sha256(configJson);
String storagePath = String.format("configs/%s/%s/%s.json", siteId, version, configHash.substring(0, 8));
String storagePath = String.format("configs/%s/pending/%s.json", siteId, configHash.substring(0, 8));
// 相同 hash 的提交 → 真正重复,跳过
SiteConfig sameHash = siteConfigMapper.selectOne(