Revert "refactor(storage): 简化存储适配器配置逻辑并移除降级机制"

This reverts commit 95c82cfcf2.
This commit is contained in:
2026-02-05 22:29:52 +08:00
parent ee2482a55a
commit 1e71add551
8 changed files with 102 additions and 66 deletions

View File

@@ -468,14 +468,12 @@ public class PuzzleGenerateServiceImpl implements IPuzzleGenerateService {
// 上传到OSS
try (FileInputStream fis = new FileInputStream(qrcode)) {
String fileName = String.format("qrcode_%d.jpg", faceId);
var storageAdapter = StorageFactory.use();
boolean exists = storageAdapter.isExists("puzzle", "wechat_qrcode", fileName);
boolean exists = StorageFactory.use().isExists("puzzle", "wechat_qrcode", fileName);
if (exists) {
String url = storageAdapter.getUrl("puzzle", "wechat_qrcode", fileName);
log.debug("微信小程序二维码已存在, 不重复上传: faceId={}, url={}", faceId, url);
return url;
log.debug("微信小程序二维码已存在, 不重复上传: faceId={}, url={}", faceId, StorageFactory.use().getUrl("puzzle", "wechat_qrcode", fileName));
return StorageFactory.use().getUrl("puzzle", "wechat_qrcode", fileName);
}
return storageAdapter.uploadFile(
return StorageFactory.use().uploadFile(
"image/jpeg",
fis,
"puzzle",