|
|
@@ -10,10 +10,14 @@ import cn.reghao.oss.sdk.model.dto.media.ConvertedImageInfo;
|
|
|
import cn.reghao.oss.sdk.model.dto.media.ImageInfo;
|
|
|
import cn.reghao.oss.sdk.model.dto.media.VideoInfo;
|
|
|
import cn.reghao.tnb.file.app.config.AppProperties;
|
|
|
+import cn.reghao.tnb.file.app.db.mapper.StoreConfigMapper;
|
|
|
import cn.reghao.tnb.file.app.model.constant.OssType;
|
|
|
+import cn.reghao.tnb.file.app.model.po.StoreConfig;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
+
|
|
|
/**
|
|
|
* @author reghao
|
|
|
* @date 2024-07-03 14:40:25
|
|
|
@@ -25,12 +29,20 @@ public class StoreServiceWrapperRouter implements OssService {
|
|
|
private final int ossType;
|
|
|
private final ConsoleService consoleService;
|
|
|
private final StoreServiceWrapper storeServiceWrapper;
|
|
|
+ private final StoreConfigMapper storeConfigMapper;
|
|
|
|
|
|
public StoreServiceWrapperRouter(AppProperties appProperties, ConsoleService consoleService,
|
|
|
- StoreServiceWrapper storeServiceWrapper) {
|
|
|
+ StoreServiceWrapper storeServiceWrapper, StoreConfigMapper storeConfigMapper) {
|
|
|
this.ossType = appProperties.getOssType();
|
|
|
this.consoleService = consoleService;
|
|
|
this.storeServiceWrapper = storeServiceWrapper;
|
|
|
+ this.storeConfigMapper = storeConfigMapper;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostConstruct
|
|
|
+ public void postSetOwner() {
|
|
|
+ StoreConfig storeConfig = storeConfigMapper.findByOssType(OssType.localOss.getValue());
|
|
|
+ this.owner = Integer.parseInt(storeConfig.getAccessKeyId());
|
|
|
}
|
|
|
|
|
|
public ServerInfo getUploadStore(int channelCode) throws Exception {
|