本文整理匯總了Java中org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity類的典型用法代碼示例。如果您正苦於以下問題:Java WxMsgImageEntity類的具體用法?Java WxMsgImageEntity怎麽用?Java WxMsgImageEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WxMsgImageEntity類屬於org.hamster.weixinmp.dao.entity.msg包,在下文中一共展示了WxMsgImageEntity類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveMsgImg
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity; //導入依賴的package包/類
public WxMsgImageEntity saveMsgImg(Element ele) throws DocumentException {
WxMsgImageEntity msgImg = WxXmlUtil.getMsgImage(ele);
if (msgImgDao != null) {
msgImgDao.save(msgImg);
} else {
}
return msgImg;
}
示例2: testGetMsgImg
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity; //導入依賴的package包/類
@Test
public void testGetMsgImg() throws DocumentException {
WxMsgImageEntity msgImg = WxXmlUtil.getMsgImage(WxXmlUtil.toXML(MSG_IMG_XML));
assertBaseFieldsWithMsgId(msgImg);
//Assert.assertEquals("this is a url", msgImg.getImage().getPicUrl());
}
示例3: getMsgImage
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity; //導入依賴的package包/類
/**
* <code>
* <xml>
* <ToUserName><![CDATA[toUser]]></ToUserName>
* <FromUserName><![CDATA[fromUser]]></FromUserName>
* <CreateTime>1348831860</CreateTime>
* <MsgType><![CDATA[image]]></MsgType>
* <PicUrl><![CDATA[this is a url]]></PicUrl>
* <MediaId><![CDATA[media_id]]></MediaId>
* <MsgId>1234567890123456</MsgId>
* </xml>
* </code>
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgImageEntity getMsgImage(Element ele) throws DocumentException {
WxMsgImageEntity result = msgEntityFactory(WxMsgImageEntity.class, ele);
WxItemImageEntity image = new WxItemImageEntity();
image.setMediaId(strVal(ele, "MediaId"));
image.setPicUrl(strVal(ele, "PicUrl"));
result.setImage(image);
return result;
}