You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1002 B
Java
36 lines
1002 B
Java
package com.supervision.rasa.controller;
|
|
|
|
|
|
import com.supervision.rasa.service.RasaFileService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import java.io.IOException;
|
|
|
|
@Api(tags = "rasa文件保存")
|
|
@RestController
|
|
@RequestMapping("rasaFile")
|
|
@RequiredArgsConstructor
|
|
public class RasaFileController {
|
|
|
|
private final RasaFileService rasaFileService;
|
|
|
|
@ApiOperation("接受并保存rasa文件")
|
|
@PostMapping("/saveRasaFile")
|
|
public String saveRasaFile(@RequestParam("file") MultipartFile file) throws IOException {
|
|
|
|
if (file == null || file.isEmpty()) {
|
|
return "file is empty";
|
|
}
|
|
|
|
rasaFileService.saveRasaFile(file);
|
|
return "ok";
|
|
|
|
}
|
|
}
|