feign提供文件查询
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sdm.common.entity.enums.FileBizTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class GetSimulationTaskFileReq extends BaseReq {
|
||||
@Schema(description = "文件所属项目节点uuid")
|
||||
private String uuid;
|
||||
|
||||
@Schema(description = "文件类型", implementation = FileBizTypeEnum.class)
|
||||
Integer fileBizType;
|
||||
|
||||
@Schema(description = "文件名")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "标签1")
|
||||
private String tag1;
|
||||
|
||||
@Schema(description = "标签2")
|
||||
private String tag2;
|
||||
|
||||
@Schema(description = "标签3")
|
||||
private String tag3;
|
||||
|
||||
@Schema(description = "标签4")
|
||||
private String tag4;
|
||||
|
||||
@Schema(description = "标签5")
|
||||
private String tag5;
|
||||
|
||||
@Schema(description = "标签6")
|
||||
private String tag6;
|
||||
|
||||
@Schema(description = "标签7")
|
||||
private String tag7;
|
||||
|
||||
@Schema(description = "标签8")
|
||||
private String tag8;
|
||||
|
||||
@Schema(description = "标签9")
|
||||
private String tag9;
|
||||
|
||||
@Schema(description = "标签10")
|
||||
private String tag10;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.sdm.common.feign.impl.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.data.IDataAnalysisFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DataAnalysisFeignClientImpl implements IDataAnalysisFeignClient {
|
||||
@Autowired
|
||||
IDataAnalysisFeignClient dataAnalysisFeignClient;
|
||||
|
||||
@Override
|
||||
public SdmResponse getSimulationTaskFile(GetSimulationTaskFileReq getSimulationTaskFileReq) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = dataAnalysisFeignClient.getSimulationTaskFile(getSimulationTaskFileReq);
|
||||
log.info("查询文件夹列表响应:"+ response);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("查询文件夹列表失败", e);
|
||||
return SdmResponse.failed("查询文件夹列表失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.sdm.common.feign.inter.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = "data",contextId = "dataAnalysisFeignClient")
|
||||
public interface IDataAnalysisFeignClient {
|
||||
@PostMapping("/getSimulationTaskFile")
|
||||
public SdmResponse getSimulationTaskFile(@RequestBody GetSimulationTaskFileReq getSimulationTaskFileReq);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "data")
|
||||
@FeignClient(name = "data",contextId = "dataFeignClient")
|
||||
public interface IDataFeignClient {
|
||||
@GetMapping("/data/listDir")
|
||||
SdmResponse<List<FileMetadataInfoResp>> listDir( @RequestParam(value = "dirType") Integer dirType,@RequestParam(value = "parentDirId", required = false) Long parentDirId);
|
||||
|
||||
Reference in New Issue
Block a user