package com.muyu.rule.remote;

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.Factory.RuleFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@EnableFeignClients
@FeignClient(value = "cloud-etl-rule",fallbackFactory= RuleFactory.class)
public interface RuleFeign {
    @PostMapping("/version/findVersionById/{id}")
    public Result<RuleEngineVersion> findVersionById(@PathVariable("id") Long id);
    @PostMapping("/version/testEngine/{className}")
    public Result<DataValue> testEngine(@PathVariable("className") String className,@RequestBody DataValueFie dataValue);
    @PostMapping("/version/rowEngine/{className}")
    public Result<DataValue[]> testEngine(@PathVariable("className") String className,@RequestBody DataValueRow dataValue);
    @PostMapping("/version/DataSetEngine/{className}")
    public Result<DataValue[][]> DataSetEngine(@PathVariable("className") String className,@RequestBody DataValueRows dataValues);
}
