|
@@ -46,34 +46,13 @@ public class ScoreRuleController extends BaseController {
|
|
|
@RequestMapping(value= UrlConstants.API_KIBUG+"scoreRule", method = RequestMethod.GET)
|
|
|
public Map<String, Object> get(@RequestParam(name = "taskId") Long taskId,
|
|
|
@RequestParam(name = "caseId") Long caseId) throws Exception {
|
|
|
- Exam exam = examService.getTask(taskId);
|
|
|
- CaseExtends caseExtends = caseService.getCaseExtendsById(caseId);
|
|
|
List<ScoreRuleItemVO> scoreRules = scoreRuleService.getGenaralScoreRule(taskId, caseId);
|
|
|
List<String> options = new ArrayList<>();
|
|
|
- if(examPythonCommunityService.isPythonCommunityExam(taskId) || caseService.getCaseProperties(caseId).get("testType").equals("8")){
|
|
|
+ if(isScoreByPassCaseCount(taskId, caseId)){
|
|
|
options.add(ScoreRuleKey.cases.toString());
|
|
|
}
|
|
|
options.add(ScoreRuleKey.manual.toString());
|
|
|
options.addAll(scoreRuleService.getOptionsFromNode(taskId, caseId));
|
|
|
-// switch(caseExtends.getAnswerWay().intValue()){
|
|
|
-// case (int) AnswerWayConstants.DEV_ECLIPSE:
|
|
|
-// case (int) AnswerWayConstants.JMETER:
|
|
|
-// case (int) AnswerWayConstants.WEB_ECLIPSE: //selenium
|
|
|
-//
|
|
|
-//
|
|
|
-// break;
|
|
|
-// case (int) AnswerWayConstants.APP_ECLIPSE:
|
|
|
-//
|
|
|
-//
|
|
|
-// case (int) AnswerWayConstants.THIRD_PARTY:
|
|
|
-// case (int) AnswerWayConstants.REPORT:
|
|
|
-// case (int) AnswerWayConstants.ZHICEYUN:
|
|
|
-// scoreRules = scoreRuleService.getKibugScoreRule(examId,caseId);
|
|
|
-// options = scoreRuleService.getKibugOptions();
|
|
|
-// break;
|
|
|
-// default :return new ErrorResult(StatusCode.PARAMETER_ERROR);
|
|
|
-// }
|
|
|
-
|
|
|
ScoreRuleVO vo = new ScoreRuleVO();
|
|
|
vo.setCaseId(caseId);
|
|
|
vo.setTaskId(taskId);
|
|
@@ -82,6 +61,14 @@ public class ScoreRuleController extends BaseController {
|
|
|
return SuccessResult.ok(ResponseMessage.ITEM_RESULT, vo);
|
|
|
}
|
|
|
|
|
|
+ public boolean isScoreByPassCaseCount(Long taskId, Long caseId) {
|
|
|
+ return examPythonCommunityService.isPythonCommunityExam(taskId) || isTddCase(caseId);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isTddCase(Long caseId) {
|
|
|
+ return caseService.getCaseProperties(caseId).get("testType").equals("8");
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value= UrlConstants.API_KIBUG+"scoreRule/{taskId}/{caseId}", method = RequestMethod.POST)
|
|
|
public Map<String, Object> updateScoreRule(@PathVariable @NotNull Long caseId,
|
|
|
@PathVariable @NotNull Long taskId,
|