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

import cn.ey.biz.module.weaver.common.Constants;
import cn.ey.biz.module.weaver.common.RSP;
import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
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;
import java.util.List;

/**
 * 流程实例：获取流程相关资源(对外)
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface GetRequestResourcesService {

    @RequestMapping(method= RequestMethod.GET, value="/api/workflow/paService/getRequestResources",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    RSP<List<RequestResourcesResponse>> getRequestResources(@RequestBody RequestResourcesRequest request);

    @Data
    class RequestResourcesRequest{
        String requestid;        //必填	 请求ID
    }

    @Data
    class RequestResourcesResponse{
        String createdate;
        String createrName;
        Integer createrid;
        String createtime;
        Integer id;
        String name;
        Integer type;
    }

}
