feign提供文件删除
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "删除文件请求参数")
|
||||
public class DelFileReq {
|
||||
@Schema(description = "删除的文件id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long delFileId;
|
||||
|
||||
@Schema(description = "父路径")
|
||||
private String parentPath;
|
||||
|
||||
@Schema(description = "文件名称")
|
||||
private String dirName;
|
||||
|
||||
// 0相对路径,1绝对路径
|
||||
@Schema(description = "路径类型: 0相对路径,1绝对路径", defaultValue = "0")
|
||||
private Integer type = 0;
|
||||
|
||||
@Schema(description = "知识库文件审批模板id")
|
||||
private String templateId;
|
||||
|
||||
@Schema(description = "知识库文件审批模板名称")
|
||||
private String templateName;
|
||||
|
||||
}
|
||||
@@ -82,6 +82,19 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse delFile(DelFileReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = dataClient.delFile(req);
|
||||
log.info("删除文件响应:"+ response);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("删除文件响应失败", e);
|
||||
return SdmResponse.failed("删除文件响应失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse approveDataFile(LaunchApproveReq req) {
|
||||
SdmResponse response;
|
||||
|
||||
@@ -37,6 +37,9 @@ public interface IDataFeignClient {
|
||||
@PostMapping("/data/delDir")
|
||||
SdmResponse delDir(@RequestBody @Validated DelDirReq req);
|
||||
|
||||
@PostMapping("/data/delFile")
|
||||
SdmResponse delFile(@RequestBody @Validated DelFileReq req);
|
||||
|
||||
@PostMapping("/data/approveDataFile")
|
||||
SdmResponse approveDataFile(@RequestBody LaunchApproveReq req);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user