本文整理汇总了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;
}