package cn.ey.biz.module.weaver.api;

import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import cn.ey.biz.module.weaver.common.Constants;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 获取流程状态
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface GetStatusByIdService {

    @RequestMapping(method= RequestMethod.POST, value="api/ey/request/getStatusById",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
    StatusByIdResponse getStatusById(@RequestBody StatusByIdRequest request);

    @Data
    class StatusByIdRequest{
        String requestid;
    }

    @Data
    class StatusByIdResponse{
        Boolean api_status;
        String api_msg;
        ApiDataResponse api_data;
    }

    @Data
    class ApiDataResponse {
        String status;
    }

}
