package net.northking.cctp.project.bus.feign;

import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.project.dto.process.StatusRoleDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "cctp-flowable", path = "/cctp-flowable", configuration = {FeignCctpConfig.class})
public interface FlowFeign {
    /**
     * 资源名称
     */
    String RESOURCE_NAME = "/v1/query/state";

    @ApiOperation(value = "获取开始结束状态")
    @PostMapping(value = RESOURCE_NAME + "/special",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultWrapper<List<String>> querySpecialState(@RequestBody StatusRoleDto stateAuth);

    @ApiOperation(value = "获取开始结束状态")
    @PostMapping(value = "/pub/query/state/special",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultWrapper<List<String>> queryInitialState(@RequestBody StatusRoleDto stateAuth);

}
