Search in sources :

Example 1 with CommonValidateService

use of com.tony.billing.service.api.CommonValidateService in project BillingDubbo by TonyJiangWJ.

the class OwnershipValidator method isValid.

@Override
public boolean isValid(Object value, ConstraintValidatorContext context) {
    CommonValidateService commonValidateService = Objects.requireNonNull(BeanHelper.getBean(DubboBeanBridge.class)).getCommonValidateService();
    if (commonValidateService != null) {
        boolean result = commonValidateService.validateOwnership(table, value);
        logger.debug("针对数据表:{} 数据所有权校验结果:{}", table.getTableName(), result ? "通过" : "不通过");
        return result;
    } else {
        logger.error("校验service注入失败");
        return false;
    }
}
Also used : CommonValidateService(com.tony.billing.service.api.CommonValidateService)

Aggregations

CommonValidateService (com.tony.billing.service.api.CommonValidateService)1