|
@@ -4,6 +4,7 @@ import com.google.gson.Gson;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import okhttp3.*;
|
|
import okhttp3.*;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.FileCopyUtils;
|
|
import org.springframework.util.FileCopyUtils;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -26,6 +27,16 @@ import static cn.hutool.core.io.FileUtil.getMimeType;
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
public class FileManagerService {
|
|
public class FileManagerService {
|
|
|
|
+ @Value("${authorUrl}")
|
|
|
|
+ private String PCSUrl;
|
|
|
|
+ @Value("${OPSUrl}")
|
|
|
|
+ private String OPSUrl;
|
|
|
|
+ @Value("${PASUrl}")
|
|
|
|
+ private String PASUrl;
|
|
|
|
+ @Value("${RMSUrl}")
|
|
|
|
+ private String RMSUrl;
|
|
|
|
+ @Value("${FMSUrl}")
|
|
|
|
+ private String FMSUrl;
|
|
|
|
|
|
public String uploadFile(List<MultipartFile> multipartFiles, Integer sourceId) throws IOException {
|
|
public String uploadFile(List<MultipartFile> multipartFiles, Integer sourceId) throws IOException {
|
|
List<File> files = new ArrayList<>();
|
|
List<File> files = new ArrayList<>();
|
|
@@ -50,7 +61,7 @@ public class FileManagerService {
|
|
.readTimeout(60, TimeUnit.SECONDS)
|
|
.readTimeout(60, TimeUnit.SECONDS)
|
|
.build();
|
|
.build();
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://localhost:8111" + "/fileManager/uploadSystemFile")
|
|
|
|
|
|
+ .url(FMSUrl + "/fileManager/uploadSystemFile")
|
|
.post(requestBody)
|
|
.post(requestBody)
|
|
.build();
|
|
.build();
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|