package com.muyu.client.basic.impl;

import com.muyu.client.basic.RuleConfig;
import com.muyu.common.core.domain.Result;
import com.muyu.etl.domain.DataValue;
import com.muyu.rule.common.domain.DataValueFie;
import com.muyu.rule.common.domain.DataValueRow;
import com.muyu.rule.common.domain.DataValueRows;
import com.muyu.rule.common.domain.RuleEngineVersion;
import com.muyu.rule.remote.RuleFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RuleConfigImpl implements RuleConfig {

    @Autowired
    private RuleFeign ruleFeign;

    @Override
    public Result<RuleEngineVersion> findVersionById(Long id) {
        return ruleFeign.findVersionById(id);
    }

    @Override
    public Result<DataValue> testEngine(String className, DataValueFie dataValue) {
        return ruleFeign.testEngine(className, dataValue);
    }

    @Override
    public Result<DataValue[]> testEngine(String className, DataValueRow dataValue) {
        return ruleFeign.testEngine(className, dataValue);
    }

    @Override
    public Result<DataValue[][]> DataSetEngine(String className, DataValueRows dataValues) {
        return ruleFeign.DataSetEngine(className, dataValues);
    }
}
