|
@@ -3,6 +3,8 @@ package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.aliyun.oss.OSSClient;
|
|
|
+import com.aliyun.oss.internal.OSSUtils;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.ucenter.common.BaseController;
|
|
@@ -12,6 +14,7 @@ import com.fdkankan.ucenter.common.constants.ConstantFilePath;
|
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCodeMsg;
|
|
|
+import com.fdkankan.ucenter.config.FyunConfig;
|
|
|
import com.fdkankan.ucenter.entity.ScenePlus;
|
|
|
import com.fdkankan.ucenter.entity.User;
|
|
|
import com.fdkankan.ucenter.exception.BusinessException;
|
|
@@ -307,13 +310,14 @@ public class SceneController extends BaseController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ FyunConfig fyunConfig;
|
|
|
|
|
|
@PostMapping("/getUploadUrl")
|
|
|
public Result getUploadUrl( @RequestParam(value = "fileName",required = false)String fileName) {
|
|
|
String newFileName = UUID.randomUUID().toString().replace("-","");
|
|
|
String suffix = fileName.substring(fileName.lastIndexOf("."));
|
|
|
-
|
|
|
- URL presignedUrl = fYunFileServiceInterface.getPresignedUrl("ucenter/e57/" + newFileName + suffix);
|
|
|
+ URL presignedUrl = fyunConfig.getPresignedUrl("ucenter/e57/" + newFileName + suffix);
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
map.put("newFileName",newFileName + suffix);
|
|
|
map.put("url",presignedUrl.toString().replace("-internal",""));
|