|
|
|
@ -3,14 +3,19 @@ package com.sztzjy.financial_bigdata.controller.stu;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.TrainingReport;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.file.IFileUtil;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -25,6 +30,10 @@ import java.util.concurrent.TimeUnit;
|
|
|
|
|
@Api(tags = "jupyter运行python代码")
|
|
|
|
|
@RequestMapping("/api/jupyter")
|
|
|
|
|
public class JupyterController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
IFileUtil iFileUtil;
|
|
|
|
|
|
|
|
|
|
@ApiOperation("文件校验")
|
|
|
|
|
@PostMapping("/validate")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -252,6 +261,22 @@ public class JupyterController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@ApiOperation("python下载生成文件")
|
|
|
|
|
@GetMapping("downloadFileByPython")
|
|
|
|
|
public void downloadFileByPython(@RequestParam String caseName, @RequestParam String name, HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
//存在就下载
|
|
|
|
|
String path = "/usr/local/tianzeProject/financial_bigdata_total/py/data/";
|
|
|
|
|
|
|
|
|
|
iFileUtil.download(response, caseName, path+name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|