| | |
| | | private SettingService settingService; |
| | | |
| | | @Autowired |
| | | private QiniuFileManage qiniuFileManage; |
| | | |
| | | @Autowired |
| | | private AliFileManage aliFileManage; |
| | | |
| | | @Autowired |
| | | private TencentFileManage tencentFileManage; |
| | | |
| | | @Autowired |
| | | private MinioFileManage minioFileManage; |
| | | |
| | | @Autowired |
| | | private LocalFileManage localFileManage; |
| | | |
| | | /** |
| | |
| | | |
| | | Setting setting = settingService.get(SettingConstant.OSS_USED); |
| | | if (setting == null || StrUtil.isBlank(setting.getValue())) { |
| | | throw new XbootException("您还未配置OSS存储服务"); |
| | | throw new XbootException("您还未配置存储地址"); |
| | | } |
| | | String type = setting.getValue(); |
| | | if ((type.equals(SettingConstant.QINIU_OSS) && location == null) || CommonConstant.OSS_QINIU.equals(location)) { |
| | | return qiniuFileManage; |
| | | } else if ((type.equals(SettingConstant.ALI_OSS) && location == null) || CommonConstant.OSS_ALI.equals(location)) { |
| | | return aliFileManage; |
| | | } else if ((type.equals(SettingConstant.TENCENT_OSS) && location == null) || CommonConstant.OSS_TENCENT.equals(location)) { |
| | | return tencentFileManage; |
| | | } else if ((type.equals(SettingConstant.MINIO_OSS) && location == null) || CommonConstant.OSS_MINIO.equals(location)) { |
| | | return minioFileManage; |
| | | } else if ((type.equals(SettingConstant.LOCAL_OSS) && location == null) || CommonConstant.OSS_LOCAL.equals(location)) { |
| | | if ((type.equals(SettingConstant.LOCAL_OSS) && location == null) || CommonConstant.OSS_LOCAL.equals(location)) { |
| | | return localFileManage; |
| | | } else { |
| | | throw new XbootException("暂不支持该存储配置,请检查配置"); |