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;

/**
 *流程实例：转发、意见征询、转办(对外)
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface ForwardRequestService {

    @RequestMapping(method= RequestMethod.POST, value="/api/workflow/paService/forwardRequest",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    RSP<ForwardResponse> forwardRequest(@RequestBody forwardRequest request);

    @Data
    class forwardRequest{
        String forwardFlag;		        //必填	标识1 : 转发 2：意见征询 3：转办	""
        String forwardResourceIds;		    //必填	接收人ID串，注意如果是转办 接收人只能是一个人	""
        String otherParams;		//非必填	其他扩展参数，比如意见相关流程、相关文档、附件等
        String remark;		                //非必填	意见内容	""
        String requestId;		            //必填	转发的流程请求ID	""
        //String userId;	                    //必填	转发人Id	"该参数无效，取当前的登录人作为接口的调用者"
    }

    @Data
    class ForwardOtherParams{
        String signdocids;
        String signworkflowids;
        String annexdocids;
    }

    @Data
    class ForwardResponse{

    }

}
