refactor(项目管理): 误报规则返回启用数量

This commit is contained in:
WangXu10 2024-09-05 10:51:44 +08:00 committed by Craftsman
parent a6a09d72e0
commit 22c5bb9125
2 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,8 @@ public class ProjectApplicationController {
Map<String, Object> configMap = projectApplicationService.get(request, types);
int errorNum = projectApplicationService.getFakeErrorList(request.getProjectId());
configMap.put("FAKE_ERROR_NUM", errorNum);
int enableErrorNum = projectApplicationService.getEnableFakeErrorList(request.getProjectId());
configMap.put("ENABLE_FAKE_ERROR_NUM", enableErrorNum);
return configMap;
}

View File

@ -715,4 +715,11 @@ public class ProjectApplicationService {
}
return plugin.getName();
}
public int getEnableFakeErrorList(String projectId) {
FakeErrorExample example = new FakeErrorExample();
example.createCriteria().andProjectIdEqualTo(projectId).andEnableEqualTo(true);
long l = fakeErrorMapper.countByExample(example);
return (int) l;
}
}