|
@@ -89,12 +89,12 @@ public class SceneEvaluationRuleService {
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "非管理员禁止上传文件");
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "非管理员禁止上传文件");
|
|
}
|
|
}
|
|
// 检查文件内容是否合规
|
|
// 检查文件内容是否合规
|
|
- String pyStr = new String(file.getBytes(), StandardCharsets.UTF_8);
|
|
|
|
- //1 校验 python 语法错误
|
|
|
|
- String pylint = PythonUtil.pylint(pyStr, PythonUtil.C, PythonUtil.R, PythonUtil.W, PythonUtil.E0401, PythonUtil.E0601);
|
|
|
|
- if (!pylint.contains(PythonUtil.PASS)) {
|
|
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "代码格式错误,请检查。");
|
|
|
|
- }
|
|
|
|
|
|
+// String pyStr = new String(file.getBytes(), StandardCharsets.UTF_8);
|
|
|
|
+// //1 校验 python 语法错误
|
|
|
|
+// String pylint = PythonUtil.pylint(pyStr, PythonUtil.C, PythonUtil.R, PythonUtil.W, PythonUtil.E0401, PythonUtil.E0601);
|
|
|
|
+// if (!pylint.contains(PythonUtil.PASS)) {
|
|
|
|
+// return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "代码格式错误,请检查。");
|
|
|
|
+// }
|
|
// 获取文件原本的名字
|
|
// 获取文件原本的名字
|
|
String originName = file.getOriginalFilename();
|
|
String originName = file.getOriginalFilename();
|
|
if (null == originName) {
|
|
if (null == originName) {
|