@@ -263,6 +263,81 @@ public class WxMpXmlMessage implements Serializable {
263263 @ XStreamAlias ("FailReason" )
264264 private String failReason ;
265265
266+
267+ ///////////////////////////////////////
268+ // 微信硬件平台相关事件推送
269+ ///////////////////////////////////////
270+ /**
271+ * 设备类型,目前为"公众账号原始ID"
272+ */
273+ @ XStreamAlias ("DeviceType" )
274+ @ XStreamConverter (value = XStreamCDataConverter .class )
275+ private String deviceType ;
276+
277+ /**
278+ * 设备ID,第三方提供
279+ */
280+ @ XStreamAlias ("DeviceId" )
281+ @ XStreamConverter (value = XStreamCDataConverter .class )
282+ private String deviceId ;
283+
284+
285+ @ XStreamAlias ("HardWare" )
286+ private HardWare hardWare = new HardWare ();
287+
288+ /**
289+ * 请求类型:0:退订设备状态;1:心跳;(心跳的处理方式跟订阅一样)2:订阅设备状态
290+ */
291+ @ XStreamAlias ("OpType" )
292+ private Integer opType ;
293+
294+ /**
295+ * 设备状态:0:未连接;1:已连接
296+ */
297+ @ XStreamAlias ("DeviceStatus" )
298+ private Integer deviceStatus ;
299+
300+ public Integer getOpType () {
301+ return opType ;
302+ }
303+
304+ public void setOpType (Integer opType ) {
305+ this .opType = opType ;
306+ }
307+
308+ public Integer getDeviceStatus () {
309+
310+ return deviceStatus ;
311+ }
312+
313+ public void setDeviceStatus (Integer deviceStatus ) {
314+ this .deviceStatus = deviceStatus ;
315+ }
316+
317+ public HardWare getHardWare () {
318+ return hardWare ;
319+ }
320+
321+ public void setHardWare (HardWare hardWare ) {
322+ this .hardWare = hardWare ;
323+ }
324+
325+ public String getDeviceType () {
326+ return deviceType ;
327+ }
328+
329+ public void setDeviceType (String deviceType ) {
330+ this .deviceType = deviceType ;
331+ }
332+
333+ public String getDeviceId () {
334+ return deviceId ;
335+ }
336+
337+ public void setDeviceId (String deviceId ) {
338+ this .deviceId = deviceId ;
339+ }
340+
266341 public Long getExpiredTime () {
267342 return this .expiredTime ;
268343 }
@@ -346,7 +421,6 @@ public void setCreateTime(Long createTime) {
346421 * {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
347422 * {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
348423 * </pre>
349- *
350424 */
351425 public String getMsgType () {
352426 return this .msgType ;
@@ -555,17 +629,17 @@ public static WxMpXmlMessage fromXml(InputStream is) {
555629 * @param msgSignature
556630 */
557631 public static WxMpXmlMessage fromEncryptedXml (String encryptedXml ,
558- WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
559- String msgSignature ) {
632+ WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
633+ String msgSignature ) {
560634 WxMpCryptUtil cryptUtil = new WxMpCryptUtil (wxMpConfigStorage );
561635 String plainText = cryptUtil .decrypt (msgSignature , timestamp , nonce ,
562636 encryptedXml );
563637 return fromXml (plainText );
564638 }
565639
566640 public static WxMpXmlMessage fromEncryptedXml (InputStream is ,
567- WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
568- String msgSignature ) {
641+ WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
642+ String msgSignature ) {
569643 try {
570644 return fromEncryptedXml (IOUtils .toString (is , "UTF-8" ), wxMpConfigStorage ,
571645 timestamp , nonce , msgSignature );
@@ -719,6 +793,44 @@ public void setFromKfAccount(String fromKfAccount) {
719793 this .fromKfAccount = fromKfAccount ;
720794 }
721795
796+ @ XStreamAlias ("HardWare" )
797+ public static class HardWare {
798+ @ Override
799+ public String toString () {
800+ return ToStringUtils .toSimpleString (this );
801+ }
802+
803+ /**
804+ * 消息展示,目前支持myrank(排行榜)
805+ */
806+ @ XStreamAlias ("MessageView" )
807+ @ XStreamConverter (value = XStreamCDataConverter .class )
808+ private String messageView ;
809+
810+ /**
811+ * 消息点击动作,目前支持ranklist(点击跳转排行榜)
812+ */
813+ @ XStreamAlias ("MessageAction" )
814+ @ XStreamConverter (value = XStreamCDataConverter .class )
815+ private String messageAction ;
816+
817+ public String getMessageView () {
818+ return messageView ;
819+ }
820+
821+ public void setMessageView (String messageView ) {
822+ this .messageView = messageView ;
823+ }
824+
825+ public String getMessageAction () {
826+ return messageAction ;
827+ }
828+
829+ public void setMessageAction (String messageAction ) {
830+ this .messageAction = messageAction ;
831+ }
832+ }
833+
722834 @ XStreamAlias ("ScanCodeInfo" )
723835 public static class ScanCodeInfo {
724836 @ Override
0 commit comments