|
@@ -1,15 +1,9 @@
|
|
|
package com.zksy.visualization.controller;
|
|
package com.zksy.visualization.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
-import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
-import com.fasterxml.jackson.databind.type.TypeFactory;
|
|
|
|
|
-import com.zksy.common.domain.R;
|
|
|
|
|
|
|
+import com.zksy.common.domain.Result;
|
|
|
import com.zksy.service.MinioFileStorageService;
|
|
import com.zksy.service.MinioFileStorageService;
|
|
|
import com.zksy.visualization.config.IccConfigProperty;
|
|
import com.zksy.visualization.config.IccConfigProperty;
|
|
|
-import com.zksy.visualization.domain.response.PublicKeyResponse;
|
|
|
|
|
-import com.zksy.visualization.utils.RSAutil;
|
|
|
|
|
-import com.zksy.visualization.utils.UnsafeOkHttpClient;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import okhttp3.*;
|
|
import okhttp3.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -34,7 +28,7 @@ public class VisualizationController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MinioFileStorageService minioFileStorageService;
|
|
private MinioFileStorageService minioFileStorageService;
|
|
|
@GetMapping("/test")
|
|
@GetMapping("/test")
|
|
|
- public R test() {
|
|
|
|
|
|
|
+ public Result test() {
|
|
|
String authorization = redisTemplate
|
|
String authorization = redisTemplate
|
|
|
.opsForValue()
|
|
.opsForValue()
|
|
|
.get("Authorization:" + iccConfigProperty.getUsername());
|
|
.get("Authorization:" + iccConfigProperty.getUsername());
|
|
@@ -45,25 +39,25 @@ public class VisualizationController {
|
|
|
try {
|
|
try {
|
|
|
Response response = httpClient.newCall(request).execute();
|
|
Response response = httpClient.newCall(request).execute();
|
|
|
if(!response.isSuccessful()){
|
|
if(!response.isSuccessful()){
|
|
|
- return R.error("请求失败");
|
|
|
|
|
|
|
+ return Result.error("请求失败");
|
|
|
}
|
|
}
|
|
|
ResponseBody responseBody = response.body();
|
|
ResponseBody responseBody = response.body();
|
|
|
if (responseBody != null) {
|
|
if (responseBody != null) {
|
|
|
- return R.ok(responseBody.string());
|
|
|
|
|
|
|
+ return Result.ok(responseBody.string());
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("error:{}", e);
|
|
log.error("error:{}", e);
|
|
|
}
|
|
}
|
|
|
- return R.error("请求失败");
|
|
|
|
|
|
|
+ return Result.error("请求失败");
|
|
|
}
|
|
}
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public R upload(MultipartFile file){
|
|
|
|
|
|
|
+ public Result upload(MultipartFile file){
|
|
|
try {
|
|
try {
|
|
|
String s = minioFileStorageService.uploadFile(file, "test");
|
|
String s = minioFileStorageService.uploadFile(file, "test");
|
|
|
System.out.println(s);
|
|
System.out.println(s);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- return R.error("失败");
|
|
|
|
|
|
|
+ return Result.error("失败");
|
|
|
}
|
|
}
|
|
|
- return R.ok();
|
|
|
|
|
|
|
+ return Result.ok();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|