use of com.webank.wedatasphere.qualitis.rule.response.MultiRuleDetailResponse in project Qualitis by WeBankFinTech.
the class MultiSourceRuleServiceImpl method getMultiSourceRule.
@Override
public GeneralResponse<MultiRuleDetailResponse> getMultiSourceRule(Long ruleId) throws UnExpectedRequestException {
// Check existence of rule
Rule ruleInDb = ruleDao.findById(ruleId);
if (ruleInDb == null) {
throw new UnExpectedRequestException("rule_id [" + ruleId + "] {&DOES_NOT_EXIST}");
}
if (!ruleInDb.getRuleType().equals(RuleTypeEnum.MULTI_TEMPLATE_RULE.getCode())) {
throw new UnExpectedRequestException("rule_id: [" + ruleId + "]) {&IS_NOT_A_MULTI_TEMPLATE_RULE}");
}
Long projectInDbId = ruleInDb.getProject().getId();
String loginUser = HttpUtils.getUserName(httpServletRequest);
projectService.checkProjectExistence(projectInDbId, loginUser);
MultiRuleDetailResponse multiRuleDetailResponse = new MultiRuleDetailResponse(ruleInDb);
return new GeneralResponse<>("200", "{&SUCCEED_TO_GET_DETAIL_OF_MULTI_RULE}", multiRuleDetailResponse);
}
Aggregations