All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.weixinmp.outbound.passive.PassiveMusicMessage Maven / Gradle / Ivy

The newest version!
package net.sf.weixinmp.outbound.passive;

import java.text.MessageFormat;
/**
 * 回复音乐消息




12345678


<![CDATA[TITLE]]>






参数	是否必须	说明
ToUserName	是	接收方帐号(收到的OpenID)
FromUserName	是	开发者微信号
CreateTime	是	消息创建时间 (整型)
MsgType	是	music
Title	否	音乐标题
Description	否	音乐描述
MusicURL	否	音乐链接
HQMusicUrl	否	高质量音乐链接,WIFI环境优先使用该链接播放音乐
ThumbMediaId	是	缩略图的媒体id,通过上传多媒体文件,得到的id
 * @author Alex
 *
 */
public class PassiveMusicMessage extends PassiveStringMessage {
	private final static String xmlTemplate = "" +
			"" +
			"" +
			"{2}" +
			"" +
			"<![CDATA[{4}]]>" +
			"" +
			"" +
			"" +
			"" +
			"";
	
	public PassiveMusicMessage(String to, String from, String title, String desc, String musicUrl, String hqMusicUrl, String thumbMediaId) {
		super("text/xml;charset=utf-8", MessageFormat.format(xmlTemplate, to, from, (System.currentTimeMillis()/1000)+"", title, desc, musicUrl, hqMusicUrl, thumbMediaId));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy