當前位置: 首頁>>代碼示例>>Java>>正文


Java WxRespPicDescEntity類代碼示例

本文整理匯總了Java中org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity的典型用法代碼示例。如果您正苦於以下問題:Java WxRespPicDescEntity類的具體用法?Java WxRespPicDescEntity怎麽用?Java WxRespPicDescEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WxRespPicDescEntity類屬於org.hamster.weixinmp.dao.entity.resp包,在下文中一共展示了WxRespPicDescEntity類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseRespXML

import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity; //導入依賴的package包/類
public Element parseRespXML(WxBaseRespEntity resp) throws DocumentException {
	WxMsgRespTypeEnum type = WxMsgRespTypeEnum.inst(resp.getMsgType());
	switch (type) {
	case IMAGE:
		return WxXmlUtil.getRespImage((WxRespImageEntity) resp);
	case MUSIC:
		return WxXmlUtil.getRespMusic((WxRespMusicEntity) resp, ((WxRespMusicEntity) resp).getThumb());
	case NEWS:
		return WxXmlUtil.getRespPicDesc((WxRespPicDescEntity) resp);
	case TEXT:
		return WxXmlUtil.getRespTextXML((WxRespTextEntity) resp);
	case VIDEO:
		return WxXmlUtil.getRespVideo((WxRespVideoEntity) resp);
	case VOICE:
		return WxXmlUtil.getRespVoice((WxRespVoiceEntity) resp);
	default:
		break;
	}
	return null;
}
 
開發者ID:Charlemin,項目名稱:weixin-mp-java-master,代碼行數:21,代碼來源:WxMessageService.java

示例2: createRespPicDesc

import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity; //導入依賴的package包/類
public WxRespPicDescEntity createRespPicDesc(
		List<WxItemPicDescEntity> articles, String fromUserName,
		String toUserName, Integer funcFlag) {
	WxRespPicDescEntity respPicDesc = new WxRespPicDescEntity();
	respPicDesc.setCreatedDate(new Date());
	respPicDesc.setCreateTime(WxUtil.currentTimeInSec());
	respPicDesc.setFromUserName(fromUserName);
	respPicDesc.setToUserName(toUserName);
	respPicDesc.setFuncFlag(funcFlag);
	respPicDesc.setMsgType(WxMsgRespType.NEWS);
	respPicDesc.setArticles(articles);
	if (respPicDescDao != null) {
		respPicDescDao.save(respPicDesc);
	} else {

	}
	return respPicDesc;
}
 
開發者ID:Charlemin,項目名稱:weixin-mp-java-master,代碼行數:19,代碼來源:WxStorageService.java

示例3: createRespPicDesc2

import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity; //導入依賴的package包/類
public WxRespPicDescEntity createRespPicDesc2(List<Long> articleIds,
		String fromUserName, String toUserName, Integer funcFlag) {
	WxRespPicDescEntity respPicDesc = new WxRespPicDescEntity();
	respPicDesc.setCreatedDate(new Date());
	respPicDesc.setCreateTime(WxUtil.currentTimeInSec());
	respPicDesc.setFromUserName(fromUserName);
	respPicDesc.setToUserName(toUserName);
	respPicDesc.setFuncFlag(funcFlag);
	respPicDesc.setMsgType(WxMsgRespType.NEWS);
	respPicDesc.setArticles(wxItemPicDescDao.findByIdIn(articleIds));
	if (respPicDescDao != null) {
		respPicDescDao.save(respPicDesc);
	} else {

	}
	return respPicDesc;
}
 
開發者ID:Charlemin,項目名稱:weixin-mp-java-master,代碼行數:18,代碼來源:WxStorageService.java

示例4: getRespPicDesc

import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity; //導入依賴的package包/類
/**
 * <code>
 * &lt;xml&gt;<br />
	 * &nbsp;&nbsp;&lt;ToUserName&gt;&lt;![CDATA[toUser]]&gt;&lt;/ToUserName&gt;<br />
	 * &nbsp;&nbsp;&lt;FromUserName&gt;&lt;![CDATA[fromUser]]&gt;&lt;/FromUserName&gt;<br />
	 * &nbsp;&nbsp;&lt;CreateTime&gt;12345678&lt;/CreateTime&gt;<br />
	 * &nbsp;&nbsp;&lt;MsgType&gt;&lt;![CDATA[news]]&gt;&lt;/MsgType&gt;<br />
	 * &nbsp;&nbsp;&lt;ArticleCount&gt;2&lt;/ArticleCount&gt;<br />
	 * &nbsp;&nbsp;&lt;Articles&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&lt;item&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Title&gt;&lt;![CDATA[title1]]&gt;&lt;/Title&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Description&gt;&lt;![CDATA[description1]]&gt;&lt;/Description&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;PicUrl&gt;&lt;![CDATA[picurl]]&gt;&lt;/PicUrl&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Url&gt;&lt;![CDATA[url]]&gt;&lt;/Url&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&lt;/item&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&lt;item&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Title&gt;&lt;![CDATA[title]]&gt;&lt;/Title&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Description&gt;&lt;![CDATA[description]]&gt;&lt;/Description&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;PicUrl&gt;&lt;![CDATA[picurl]]&gt;&lt;/PicUrl&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Url&gt;&lt;![CDATA[url]]&gt;&lt;/Url&gt;<br />
	 * &nbsp;&nbsp;&nbsp;&nbsp;&lt;/item&gt;<br />
	 * &nbsp;&nbsp;&lt;/Articles&gt;<br />
	 * &nbsp;&nbsp;&lt;FuncFlag&gt;1&lt;/FuncFlag&gt;<br />
 * &lt;/xml&gt; 
 * </code>
 * 
 * @param respPicDesc
 * @return
 * @throws DocumentException
 */
public static Element getRespPicDesc(WxRespPicDescEntity respPicDesc) throws DocumentException {
	Element ele = respEntityFactory(respPicDesc);
	ele.addElement("ArticleCount").addText(String.valueOf(respPicDesc.getArticles().size()));
	Element articlesEle = ele.addElement("Articles");
	for (WxItemPicDescEntity item : respPicDesc.getArticles()) {
		Element itemEle = articlesEle.addElement("item");
		itemEle.addElement("Title").addCDATA(item.getTitle());
		itemEle.addElement("Description").addCDATA(item.getDescription());
		itemEle.addElement("PicUrl").addCDATA(item.getPicUrl());
		itemEle.addElement("HQMusicUrl").addCDATA(item.getUrl());
	}
	return ele;
}
 
開發者ID:Charlemin,項目名稱:weixin-mp-java-master,代碼行數:44,代碼來源:WxXmlUtil.java


注:本文中的org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。