package com.sino.weixin.service.rescue;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.sino.weixin.message.resp.Article;
import com.sino.weixin.message.resp.NewsMessage;
import com.sino.weixin.util.MessageUtil;

public class RescueMessageDealer {
	private static String title = "请手工提交您的当前位置信息";
	private static String content = "点击左下角键盘图标，点击 + 按钮，再点击【位置】按钮，地图上显示您的位置信息后，点击右上角的【发送】按钮，即可将您的当前所处的位置坐标发送给我们了~。";
	private static String picUrl = "http://sinoassistance.cn/wap/img/weizhi.jpg";
	
	/**
	 * 组织图文消息
	 * @param toUserName
	 * @param fromUserName
	 * @param createTime
	 * @return
	 */
	public static NewsMessage dealNewsMessage(String toUserName,String fromUserName){
		
		NewsMessage message = new NewsMessage();
		message.setToUserName(fromUserName);  
		message.setFromUserName(toUserName);  
		message.setCreateTime(new Date().getTime());  
		message.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_NEWS);  
		message.setFuncFlag(0);
		
		Article article = new Article();
		article.setTitle(title);
		article.setDescription(content);
		article.setPicUrl(picUrl);
		article.setUrl(null);
		List<Article> Articles = new ArrayList<Article>();
		Articles.add(article);
		
		message.setArticleCount(1);
		message.setArticles(Articles);
		
		return message;
		
		
	}

}
