|
|
|
@ -2,12 +2,37 @@ package com.superversion.rasa.controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
|
|
import com.superversion.rasa.service.RasaFileService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
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.io.File;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
|
|
|
|
|
|
@Api(tags = "rasa文件保存")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("rasaCmd")
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
public class RasaCmdController {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
FileUtil.rename(new File("F:\\tmp\\rasa.zip_back"),"aa",true);
|
|
|
|
|
@Autowired
|
|
|
|
|
private RasaFileService rasaFileService;
|
|
|
|
|
|
|
|
|
|
@ApiOperation("接受并保存rasa文件")
|
|
|
|
|
@PostMapping("/exec")
|
|
|
|
|
public String cmdExec(@RequestParam("file") MultipartFile file){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "ok";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|