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

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


public class SendTemplateShort extends SendTemplate {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String template_id_short;//短推送id
	
	private String topColor;//标题色
	
	private int total;//重推送次数
	
	private int interVal;//重推间隔，分钟为单位
	
	private String pushTemplateId;//tb_push_templater id
	

	public SendTemplateShort() {
		super();
	}

	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data) {
		this( touser, template_id_short, url,data,null,1, 0);
	}
	
	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,Map<String,String> valueAndColor) {
		this( touser,  template_id_short,  url, data,null, valueAndColor, 1, 0);
	}
	
	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,int total,int inter_val) {
		this( touser, template_id_short, url,data,null, total,inter_val);
	}
	
	/**
	 * @param miniprogram  跳小程序所需数据，不需跳小程序可不用传该数据
	 */
	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,Miniprogram miniprogram) {
		this( touser, template_id_short, url,data,miniprogram, 1, 0);
	}
	
	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,Miniprogram miniprogram,Map<String,String> valueAndColor) {
		this( touser,  template_id_short,  url, data,miniprogram, valueAndColor, 1,0);
	}

	
	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,Miniprogram miniprogram,int total,int inter_val) {
		super();
		this.touser = touser;
		this.template_id_short = template_id_short;
		this.url = url;
		this.total=total;
		this.interVal=inter_val;
		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();
			SendTemplateData templateData = new SendTemplateData();
			templateData.setValue(value);
			templateData.setColor("#173177");
			map.put(key, templateData);
		 }
		this.miniprogram=miniprogram;
		this.data = map;
	}

	public SendTemplateShort(String touser, String template_id_short, String url,Map<String,String> data,Miniprogram miniprogram,Map<String,String> valueAndColor,int total,int inter_val) {
		super();
		this.touser = touser;
		this.template_id_short = template_id_short;
		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();
			SendTemplateData templateData = new SendTemplateData();
			templateData.setValue(value);
			templateData.setColor(valueAndColor.get(key)!=null ? valueAndColor.get(key):"#173177");
			map.put(key, templateData);
		}
		
		this.miniprogram=miniprogram;
		this.data = map;
	}

	public String getTemplate_id_short() {
		return template_id_short;
	}
	public void setTemplate_id_short(String template_id_short) {
		this.template_id_short = template_id_short;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}

	public String getTopColor() {
		return topColor;
	}

	public void setTopColor(String topColor) {
		this.topColor = topColor;
	}

	public int getInterVal() {
		return interVal;
	}

	public void setInterVal(int interVal) {
		this.interVal = interVal;
	}

	public String getPushTemplateId() {
		return pushTemplateId;
	}

	public void setPushTemplateId(String pushTemplateId) {
		this.pushTemplateId = pushTemplateId;
	}


}
