package com.css.simulation.resource.server.infra.feign.service;

import api.common.pojo.common.ResponseBodyVO;
import api.common.pojo.param.scene.SceneEvaluationComputeParam;
import com.css.simulation.resource.server.infra.feign.config.FeignConfiguration;
import com.css.simulation.resource.server.infra.feign.fallback.SchedulerServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

//@FeignClient(name = "scheduler", url = "http://36.110.106.156:10204", path = "/simulation/resource/scheduler", fallback = SchedulerServiceFallback.class, configuration = FeignConfiguration.class)
@FeignClient(
        contextId = "scheduler",
        value = "simulation-resource-scheduler",
        path = "/simulation/resource/scheduler",
        fallback = SchedulerServiceFallback.class,
        configuration = FeignConfiguration.class
)
public interface SchedulerService {

    @PostMapping(value = "/algorithm/check")
    ResponseBodyVO<String> check(@RequestParam("minioPath") String minioPath);

    @Async
    @PostMapping(value = "/sceneEvaluation/computeSceneEvaluation")
    void computeSceneEvaluation(@RequestBody SceneEvaluationComputeParam sceneEvaluationComputeParam);

}
