You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autoflow-server-mgmt/src/main/java/kr/re/etri/autoflow/controllers/PipelineUploadController.java

35 lines
1.4 KiB

package kr.re.etri.autoflow.controllers;
import kr.re.etri.autoflow.service.PipelineUploadService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
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.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
@RestController
@RequestMapping("/pipelines")
@RequiredArgsConstructor
public class PipelineUploadController {
private final PipelineUploadService pipelineUploadService;
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Map<String, Object>> uploadPipeline(
@RequestParam("uploadfile") MultipartFile file,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "display_name", required = false) String displayName,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "namespace", required = false) String namespace) {
Map<String, Object> result = pipelineUploadService.uploadPipeline(file, name, displayName, description, namespace);
return ResponseEntity.ok(result);
}
}