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


import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import cn.ey.biz.module.weaver.common.Constants;
import cn.ey.biz.module.weaver.common.RSP;
import io.swagger.annotations.ApiModelProperty;
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 AddAgentSaveService {

    @RequestMapping(method= RequestMethod.POST, value="/api/workflow/agent/addAgentSave",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    AddAgentSaveResponse addAgentSave(@RequestBody AddAgentSaveRequest request);

    @Data
    class  AddAgentSaveRequest{
        String method;	    //固定值add
        String bagentuid;	//被代理人UID，需传入泛微人员ID
        String agentuid;	//代理人UID，需传入泛微人员ID
        String beginDate;	//开始日期
        String beginTime;	//抄送人邮箱（多个用，分割）
        String endDate;	    //结束日期
        String endTime;	    //结束时间
        String isCreateAgenter;	  //是否代理创建流程  0 否  1是
        String isProxyDeal;	      //是否代理 0 否  1是
        String rangetype;	      //代理流程范围  0全部 1 选择
        String agentrange;	      //流程范围(泛微流程workflowId，多个，分割 )
        String isPendThing;	      //代理已有待办事宜  0 否 1是
        String overlapMethod;    //是否替换
    }

    @Data
    class  AddAgentSaveResponse{
        String agentresult;   //true -成功  false-失败
    }

}
