package com.dgtly.wxportal.utils;


import java.util.Map;
import java.util.Set;

/**
 * 不是销售 获取发送文字的方法;
 */
public class CreditGetSendMessageCus<T> implements BatchSendGetSendMessage<T>{

    //发送文字模版
    private String temple;
    //发送文字和其他参数的map
    private Map<T,Integer> textObject;

    public CreditGetSendMessageCus(String template, Map<T,Integer> textObject){
        this.temple = template;
        this.textObject = textObject;
    }

    @Override
    public String getSendText(T code) {
        String str = "";
        if(textObject.containsKey(code)){
            return String.format(temple,textObject.get(code).toString(),code.toString());
        }else{
            throw new RuntimeException("未查询到相应组织代码对应的文字参数，code："+code.toString());
        }

    }



}
