TaskClient.java 1.12 KB
package com.viontech.integration.jiaoguansuo.feign;

import com.viontech.fanxing.commons.model.Task;
import com.viontech.fanxing.commons.vo.TaskVo;
import com.viontech.keliu.util.JsonMessageUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * .
 *
 * @author 谢明辉
 * @date 2022/2/21
 */

@FeignClient(value = "fanxing-task")
@Service
public interface TaskClient {

    @PostMapping("/tasks")
    JsonMessageUtil.JsonMessage<TaskVo> addTask(@RequestBody TaskVo taskVo);

    @GetMapping("/tasks")
    JsonMessageUtil.JsonMessage<List<Task>> getTask(@SpringQueryMap Task task);

    @DeleteMapping("/tasks/{id}")
    JsonMessageUtil.JsonMessage removeTask(@PathVariable("id") Long id);

    @PostMapping("/tasks/{id}")
    JsonMessageUtil.JsonMessage<TaskVo> update(@PathVariable("id") Long id, @RequestBody Task task);


    @GetMapping("/tasks/{id}/start")
    JsonMessageUtil.JsonMessage<TaskVo> startTask(@PathVariable("id") Long id);

}