package cn.qg.qaplatform.service.zdata.risk.impl;

import cn.qg.qaplatform.config.SwitchDataSource;
import cn.qg.qaplatform.mapper.zdata.RuleEngineMapper;
import cn.qg.qaplatform.service.zdata.risk.RuleEngineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 风控相关服务
 */
@Service
public class RuleEngineServiceImpl implements RuleEngineService {

    @Autowired
    RuleEngineMapper ruleEngineMapper;

    /**
     * 添加授信黑名单
     * @param uuid uuid
     * @return 成功与否
     */
    @Override
    public boolean addBlackList(String uuid) {
        SwitchDataSource.dataSourceSwitch("fe", "workflow");
        int insertResult = ruleEngineMapper.addBlackList(uuid);
        return insertResult >= 1;
    }
}
