package com.ssj.bean.weixin.push.domain;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;



public class SendTemplate implements Serializable {

    private static final long serialVersionUID = 1L;
	protected String touser;  //OPENID 推送给用户 openid
	private String template_id; //模板ID
	protected String url;   //点击URL
	protected Map<String ,SendTemplateData> data;
	protected Miniprogram miniprogram;
	
	
	public SendTemplate() {
		super();
	}
	public SendTemplate(String touser, String template_id, String url,Map<String,String> data) {
		super();
		this.touser = touser;
		this.template_id = template_id;
		this.url = url;
		Map<String, SendTemplateData>  map  =new  HashMap<String, SendTemplateData>();
		for (Map.Entry<String, String> entry : data.entrySet()) {
			String key = entry.getKey().toString();
			String value = entry.getValue().toString();
			SendTemplateData templateData = new SendTemplateData();
			templateData.setValue(value);
			templateData.setColor("#173177");
			map.put(key, templateData);
		 }
		this.data = map;
	}
	public SendTemplate(String touser, String template_id, String url,Map<String,String> data,Map<String,String> valueAndColor) {
		super();
		this.touser = touser;
		this.template_id = template_id;
		this.url = url;
		Map<String, SendTemplateData>  map  =new  HashMap<String, SendTemplateData>();
		for (Map.Entry<String,String> entry : data.entrySet()) {
			String key = entry.getKey().toString();
			String value = entry.getValue().toString();
			SendTemplateData templateData = new SendTemplateData();
			templateData.setValue(value);
			templateData.setColor(valueAndColor.get(key)!=null ? valueAndColor.get(key):"#173177");
			map.put(key, templateData);
		}
		this.data = map;
	}
	public String getTouser() {
		return touser;
	}
	public void setTouser(String touser) {
		this.touser = touser;
	}
	public String getTemplate_id() {
		return template_id;
	}
	public void setTemplate_id(String template_id) {
		this.template_id = template_id;
	}
	public String getUrl() { 
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public Map<String, SendTemplateData> getData() {
		return data;
	}
	public void setData(Map<String, SendTemplateData> data) {
		this.data = data;
	}
	public Miniprogram getMiniprogram() {
		return miniprogram;
	}
	public void setMiniprogram(Miniprogram miniprogram) {
		this.miniprogram = miniprogram;
	}

}
