|
|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.manage_jp.controller;
|
|
|
|
|
|
+import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
@@ -7,18 +8,17 @@ import com.fdkankan.manage_jp.common.Constant;
|
|
|
import com.fdkankan.manage_jp.common.Result;
|
|
|
import com.fdkankan.manage_jp.common.ResultCode;
|
|
|
import com.fdkankan.manage_jp.config.FyunConfig;
|
|
|
+import com.fdkankan.manage_jp.config.ManageConfig;
|
|
|
import com.fdkankan.manage_jp.exception.BusinessException;
|
|
|
import com.fdkankan.manage_jp.httpClient.client.FdKKClient;
|
|
|
import com.fdkankan.manage_jp.httpClient.param.UploadEditSceneParam;
|
|
|
+import com.fdkankan.manage_jp.util.RsaUtils;
|
|
|
import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
|
@@ -35,6 +35,10 @@ public class UploadController extends BaseController{
|
|
|
|
|
|
@Autowired
|
|
|
FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
+ @Autowired
|
|
|
+ FdKKClient fdKKClient;
|
|
|
+ @Autowired
|
|
|
+ ManageConfig manageConfig;
|
|
|
|
|
|
@PostMapping("/uploadImg")
|
|
|
public Result uploadImg(@RequestParam("file") MultipartFile file) throws IOException {
|
|
|
@@ -50,8 +54,7 @@ public class UploadController extends BaseController{
|
|
|
return Result.success("",url);
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- FdKKClient fdKKClient;
|
|
|
+
|
|
|
@PostMapping("/uploadE57")
|
|
|
public Result uploadE57(@RequestParam("file") MultipartFile file,Integer isObj) {
|
|
|
String originalFilename = file.getOriginalFilename();
|
|
|
@@ -145,4 +148,12 @@ public class UploadController extends BaseController{
|
|
|
}
|
|
|
return Result.success();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/getStsSignature")
|
|
|
+ public synchronized Result getStsSignature( @RequestParam(value = "appCode",required = false)String appCode,
|
|
|
+ @RequestParam(value = "timestamp",required = false)String timestamp){
|
|
|
+ String encipher = RsaUtils.encipher(appCode + "-" + timestamp,manageConfig.getStsPublicKey());
|
|
|
+ return Result.success(Base64.encode(encipher));
|
|
|
+ }
|
|
|
}
|