新增ipynb文件状态判断

master
whb 8 months ago
parent 76f22213ac
commit 0cbe7a909b

@ -208,5 +208,35 @@ public class JupyterhubController {
} }
//判断ipynb文件是否存在
@ApiOperation("判断是否上传ipynb文件")
@GetMapping("/uploadFileByIpynbExist")
@AnonymousAccess
public ResultEntity uploadFileByIpynbExist(@ApiParam("案例名")String caseName) {
String filepath = "/etc/jupyterhub/data/"+caseName+".ipynb";
File file = new File(filepath);
if (file.exists())
{
return new ResultEntity<>(HttpStatus.OK,true);
}else {
return new ResultEntity<>(HttpStatus.OK,false);
}
}
@ApiOperation("删除ipynb文件")
@GetMapping("/delUploadFileByIpynb")
@AnonymousAccess
public ResultEntity delUploadFileByIpynb(@ApiParam("案例名")String caseName) {
String filepath = "/etc/jupyterhub/data/"+caseName+".ipynb";
File file = new File(filepath);
if (file.exists())
{
file.delete();
return new ResultEntity<>(HttpStatus.OK,true);
}
return new ResultEntity<>(HttpStatus.OK,true);
}
} }

Loading…
Cancel
Save