use of com.webank.wedatasphere.qualitis.rule.response.TemplateInputDemandResponse in project Qualitis by WeBankFinTech.
the class RuleTemplateServiceImpl method getMultiSourceTemplateMeta.
@Override
public GeneralResponse<?> getMultiSourceTemplateMeta(Long templateId) throws UnExpectedRequestException {
// Check existence of template and if multi-table rule template
Template templateInDb = checkRuleTemplate(templateId);
if (!templateInDb.getTemplateType().equals(RuleTemplateTypeEnum.MULTI_SOURCE_TEMPLATE.getCode())) {
throw new UnExpectedRequestException("Template : [" + templateId + "] {&IS_NOT_A_MULTI_TEMPLATE}");
}
// return show_sql of template and template output
TemplateInputDemandResponse templateInputDemandResponse = new TemplateInputDemandResponse(templateInDb, RuleTemplateTypeEnum.MULTI_SOURCE_TEMPLATE.getCode());
LOGGER.info("Succeed to get the meta of multi_rule_template. rule_template_id: {}", templateId);
return new GeneralResponse<>("200", "{&GET_META_OF_MULTI_RULE_TEMPLATE_SUCCESSFULLY}", templateInputDemandResponse);
}
use of com.webank.wedatasphere.qualitis.rule.response.TemplateInputDemandResponse in project Qualitis by WeBankFinTech.
the class RuleTemplateServiceImpl method getRuleTemplateInputMeta.
@Override
public GeneralResponse<TemplateInputDemandResponse> getRuleTemplateInputMeta(Long ruleTemplateId) throws UnExpectedRequestException {
// Check existence of rule template
Template templateInDb = ruleTemplateDao.findById(ruleTemplateId);
if (null == templateInDb) {
throw new UnExpectedRequestException("rule_template_id {&DOES_NOT_EXIST}");
}
TemplateInputDemandResponse templateInputDemandResponse = new TemplateInputDemandResponse(templateInDb, regexpExprMapperRepository);
LOGGER.info("Succeed to get the input of rule_template. rule_template_id: {}", ruleTemplateId);
return new GeneralResponse<>("200", "{&GET_TEMPLATE_RULE_DEMAND_SUCCESSFULLY}", templateInputDemandResponse);
}
Aggregations