本文整理匯總了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;
}
示例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;
}
示例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;
}
示例4: getRespPicDesc
import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity; //導入依賴的package包/類
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[news]]></MsgType><br />
* <ArticleCount>2</ArticleCount><br />
* <Articles><br />
* <item><br />
* <Title><![CDATA[title1]]></Title><br />
* <Description><![CDATA[description1]]></Description><br />
* <PicUrl><![CDATA[picurl]]></PicUrl><br />
* <Url><![CDATA[url]]></Url><br />
* </item><br />
* <item><br />
* <Title><![CDATA[title]]></Title><br />
* <Description><![CDATA[description]]></Description><br />
* <PicUrl><![CDATA[picurl]]></PicUrl><br />
* <Url><![CDATA[url]]></Url><br />
* </item><br />
* </Articles><br />
* <FuncFlag>1</FuncFlag><br />
* </xml>
* </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;
}