package com.yida.data.job.feign;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import com.yida.data.common.core.entity.job.Job;

import com.yida.data.job.fallback.RemoteJobServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = FebsServerConstant.FEBS_SERVER_JOB, contextId = "jobServiceClient",
        fallbackFactory = RemoteJobServiceFallback.class)
public interface RemoteJobService {

    @PostMapping
    ResultBean saveJob(@RequestBody Job job);

    @PostMapping("in/job/saveJobNoPermission")
    ResultBean saveJobNoPermission(@RequestBody Job job);

    @GetMapping("/delJobByMethod")
    ResultBean delJobByMethod(@RequestParam("beanName") String beanName,
                              @RequestParam("methodName") String methodName,
                              @RequestParam("params") String params);
}
