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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 *流程实例：获取流程流转数据
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface RequestOperatorInfoService {

    @RequestMapping(method= RequestMethod.GET, value="/api/workflow/paService/getRequestOperatorInfo",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    RSP<List<OperatorInfoResponse>> operatorInfo(@RequestParam("requestid") String requestid);

    @Data
    class OperatorInfoRequest{
        Integer requestid;              //必填      请求ID
    }

    @Data
    class OperatorInfoResponse{
        Integer agentorbyagentid;
        Integer agenttype;
        Integer groupid;
        Integer id;
        Integer isremark;          //0 :节点操作人未提交，1：转发接收人未提交，2：已提交，4：已归档，8/9：抄送人 11：传阅
        String nodeName;           //节点名称
        Integer nodeid;            //节点ID
        String operatedate;
        String operatetime;
        Integer preisremark;
        String receivedate;
        String receivetime;
        String userName;          //操作人名称
        Integer userType;         //0:内部用户 1：外部用户
        Integer userid;           //操作人ID
        Integer viewType;         //0:未查看 -1：已查看有反馈 -2：已查看
    }

}
