package rpc;

import dto.ConfigExecuteRequest;
import org.springframework.beans.factory.annotation.Autowired;
import service.ConfigExecutorService;

import ru.cg.webbpm.modules.webkit.annotations.RpcCall;
import ru.cg.webbpm.modules.webkit.annotations.RpcService;
import ru.cg.webbpm.modules.webkit.beans.Behavior;

/**
 * @author Evgenii Malkov
 */
@RpcService
public class ConfigExecutorRpcService extends Behavior {

  private final ConfigExecutorService configExecutorService;

  public ConfigExecutorRpcService(@Autowired ConfigExecutorService configExecutorService) {
    this.configExecutorService = configExecutorService;
  }

  @RpcCall
  public String callConfigExecutor(String methodPath, ConfigExecuteRequest configExecuteRequest,
                                   boolean withDate) {
    return configExecutorService.call(methodPath, configExecuteRequest, withDate);
  }
}
