Package com.qq.weixin.sdk.message

Examples of com.qq.weixin.sdk.message.MessageResultMusic


    return messageResultNews;
  }

  // build result message news
  protected Message buildMessageResultMusic(ItemMusic item) {
    MessageResultMusic messageResultMusic = new MessageResultMusic();
    messageResultMusic.setMsgType(MESSAGE_RESULT_MUSIC);
    messageResultMusic.setCreateTime(getCurrentUnixTimestamp());
    messageResultMusic.setFromUserName(message.getToUserName());
    messageResultMusic.setToUserName(message.getFromUserName());
    messageResultMusic.setMusic(item);
    messageResultMusic.setFuncFlag(1);//
    return messageResultMusic;
  }
View Full Code Here


*/
public class MessageResultHandlerMusic extends MessageResultHandlerHelper {

  @Override
  public String buildMessageResult(Message message) {
    MessageResultMusic messageResultMusic = (MessageResultMusic) message;
    StringBuffer buffer = new StringBuffer();
    StringBuffer item = new StringBuffer();
    ItemMusic itemMusic = messageResultMusic.getMusic();
    item.append(wrapperContent(TAG_TITLE, itemMusic.getTitle(), true))
        .append(wrapperContent(TAG_DESCRIPTION, itemMusic.getDescription(), true))
        .append(wrapperContent(TAG_URL, itemMusic.getMusicUrl(), true))
        .append(wrapperContent(TAG_HQMUSICURL, itemMusic.getHqMusicUrl(), true));
    String music = wrapperContent(TAG_MUSIC, item.toString(), false);
    buffer.append(wrapperContent(TAG_TOUSERNAME, messageResultMusic.getToUserName(), true))
        .append(wrapperContent(TAG_FROMUSERNAME, messageResultMusic.getFromUserName(), true))
        .append(wrapperContent(TAG_CREATETIME, messageResultMusic.getCreateTime() + "", false))
        .append(wrapperContent(TAG_MSGTYPE, messageResultMusic.getMsgType(), true)).append(music)
        .append(wrapperContent(TAG_FUNCFLAG, messageResultMusic.getFuncFlag() + "", false));
    return wrapperXmlContent(buffer.toString());
  }
View Full Code Here

TOP

Related Classes of com.qq.weixin.sdk.message.MessageResultMusic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.