浏览代码

Merge branch 'fix_process_constants' into 'DEV'

整理merge后的常量,统一使用constant定义的内容



See merge request !825

menduo 7 年之前
父节点
当前提交
728e8e8e0b

+ 4 - 4
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/logic/impl/OnlineJudgeLogicImpl.java

@@ -167,8 +167,8 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
 
 
         //写入文件
         //写入文件
         String code = onlineJudgeVO.getCode () == null? "":onlineJudgeVO.getCode ();
         String code = onlineJudgeVO.getCode () == null? "":onlineJudgeVO.getCode ();
-        boolean writeSuccess = FileUtils.writingStringToFile(code,storePath + "main.py") &&
-                FileUtils.writingStringToFile(properties.toString(),storePath + ".mooctest"+ File.separator + "properties");
+        boolean writeSuccess = FileUtils.writingStringToFile(code,storePath + Constants.MAIN_NAME) &&
+                FileUtils.writingStringToFile(properties.toString(),storePath + Constants.MOOCTEST_PATH + File.separator + "properties");
         // 压缩成webide可打开的模式
         // 压缩成webide可打开的模式
         if(writeSuccess) {
         if(writeSuccess) {
             String caseName = caseService.getCaseExtendsById(onlineJudgeVO.getCaseId()).getName();
             String caseName = caseService.getCaseExtendsById(onlineJudgeVO.getCaseId()).getName();
@@ -250,7 +250,7 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
             FileUtils.unZipMultiFile (path+File.separator+"result"+File.separator+"result"+latestTimestmp+".zip",
             FileUtils.unZipMultiFile (path+File.separator+"result"+File.separator+"result"+latestTimestmp+".zip",
                     path+File.separator+"result"+File.separator);
                     path+File.separator+"result"+File.separator);
             try {
             try {
-                code = FileUtils.readToString (path+File.separator+"result"+File.separator+"main.py");
+                code = FileUtils.readToString (path+File.separator+"result"+File.separator+Constants.MAIN_NAME);
             } catch (IOException e) {
             } catch (IOException e) {
                 e.printStackTrace ();
                 e.printStackTrace ();
             }
             }
@@ -265,7 +265,7 @@ public class OnlineJudgeLogicImpl implements OnlineJudgeLogic {
             // 解压缩
             // 解压缩
             FileUtils.unZipMultiFile(path+name,path);
             FileUtils.unZipMultiFile(path+name,path);
             try {
             try {
-                code = FileUtils.readToString(path+"main.py");
+                code = FileUtils.readToString(path+Constants.MAIN_NAME);
             } catch (IOException e) {
             } catch (IOException e) {
                 e.printStackTrace ();
                 e.printStackTrace ();
             }
             }