|
@@ -28,16 +28,6 @@ public class TencentCosService implements FssService {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(TencentCosService.class);
|
|
|
|
|
|
- /**
|
|
|
- * 是否内网访问
|
|
|
- */
|
|
|
- private boolean internal;
|
|
|
-
|
|
|
- public TencentCosService setInternal(boolean internal) {
|
|
|
- this.internal = internal;
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public FileInfo writeFile(String filePath, File file, String md5) {
|
|
|
if (StringUtils.isNotEmpty(md5)) {
|
|
@@ -192,17 +182,21 @@ public class TencentCosService implements FssService {
|
|
|
|
|
|
@Override
|
|
|
public void refreshFile(String fileUrls) {
|
|
|
- //todo
|
|
|
+ // 控制台 --> 开通云函数服务 --> 设置CDN缓存刷新函数
|
|
|
+ // @see https://cloud.tencent.com/document/product/436/45597
|
|
|
}
|
|
|
|
|
|
private COSClient getClient() {
|
|
|
try {
|
|
|
- COSCredentials cred = new BasicCOSCredentials(FssProperty.FSS_ACCESS_KEY_ID,
|
|
|
- FssProperty.FSS_ACCESS_KEY_SECRET);
|
|
|
Region region = new Region(FssProperty.FSS_REGION_ID);
|
|
|
ClientConfig clientConfig = new ClientConfig(region);
|
|
|
clientConfig.setHttpProtocol(HttpProtocol.https);
|
|
|
|
|
|
+ // 同地域的内网访问? COS会智能解析到内网IP
|
|
|
+ // @see https://cloud.tencent.com/document/product/436/56556
|
|
|
+
|
|
|
+ COSCredentials cred = new BasicCOSCredentials(FssProperty.FSS_ACCESS_KEY_ID,
|
|
|
+ FssProperty.FSS_ACCESS_KEY_SECRET);
|
|
|
return new COSClient(cred, clientConfig);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|