package com.usoftchina.qywx.sdk.dto;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yingp
 * @date 2020/2/12
 */
public class ApplyApprovalReq {
    private String creator_userid;
    private String template_id;
    private Integer use_template_approver;
    private List<Approver> approver;
    private List<String> notifyer;
    private Integer notify_type;

    public ApplyApprovalReq approver(List<Approver> approver) {
        this.approver = approver;
        return this;
    }

    public ApplyApprovalReq notifyer(List<String> notifyer) {
        this.notifyer = notifyer;
        return this;
    }

    public static class Approver {
        private Integer attr;
        private List<String> userIds;

        public Approver(Integer attr, List<String> userIds) {
            this.attr = attr;
            this.userIds = userIds;
        }

        public Map<String, Object> build() {
            Map<String, Object> data = new HashMap<>(2);
            data.put("attr", attr);
            data.put("userid", userIds);
            return data;
        }
    }
}
