【采集调度器-后端HTTP API】下载采集器管理压缩包API
parent
00b6a5f453
commit
dde18d75b0
@ -0,0 +1,31 @@
|
|||||||
|
package com.docus.server.controller;
|
||||||
|
|
||||||
|
import com.docus.server.api.scheduling.management.FileApi;
|
||||||
|
import com.docus.server.service.IFileUploadService;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传下载 API
|
||||||
|
*
|
||||||
|
* @author AutoGenerator
|
||||||
|
* @since 2023-07-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class FileController implements FileApi {
|
||||||
|
@Resource
|
||||||
|
private IFileUploadService iFileUploadService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadFile(String filePath, HttpServletResponse response) throws Exception {
|
||||||
|
iFileUploadService.downloadFile(filePath, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uploadFile(MultipartFile[] multipartFiles, String pathKey) throws Exception {
|
||||||
|
iFileUploadService.uploadFile(multipartFiles, pathKey);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.docus.server.api.scheduling.management;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
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.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传下载 API
|
||||||
|
*
|
||||||
|
* @author AutoGenerator
|
||||||
|
* @since 2023-07-15
|
||||||
|
*/
|
||||||
|
@Api(value = "通用文件上传下载接口", tags = "通用文件上传下载接口")
|
||||||
|
@FeignClient(value = "collector-scheduling-management", contextId = "collector-scheduling-management.FileApi")
|
||||||
|
@RequestMapping("/sch/file")
|
||||||
|
public interface FileApi {
|
||||||
|
|
||||||
|
@ApiOperation("文件下载")
|
||||||
|
@GetMapping("/download")
|
||||||
|
void downloadFile(@RequestParam(value = "filePath") String filePath, HttpServletResponse response) throws Exception;
|
||||||
|
|
||||||
|
@ApiOperation("文件上传")
|
||||||
|
@PostMapping("/upload")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "files", value = "文件", required = true, dataTypeClass = MultipartFile.class)
|
||||||
|
})
|
||||||
|
void uploadFile(MultipartFile[] multipartFiles, String pathKey) throws Exception;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.docus.server.dto.scheduling.management.schcollectorversionfile;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集器版本列表更新包管理 AddDTO
|
||||||
|
*
|
||||||
|
* @author AutoGenerator
|
||||||
|
* @since 2023-07-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "DownloadFileDTO", description = "DownloadFileDTO")
|
||||||
|
public class DownloadFileDTO implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "采集器文件路径不能为空")
|
||||||
|
@ApiModelProperty(value = "采集器文件路径")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
// @NotNull(message = "采集器文件保存路径不能为空")
|
||||||
|
// @ApiModelProperty(value = "采集器文件保存路径")
|
||||||
|
// private String savePath;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue