@@ -263,6 +263,81 @@ public class WxMpXmlMessage implements Serializable {
263
263
@ XStreamAlias ("FailReason" )
264
264
private String failReason ;
265
265
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
<
D7AE
/td>+ 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
+
266
341
public Long getExpiredTime () {
267
342
return this .expiredTime ;
268
343
}
@@ -346,7 +421,6 @@ public void setCreateTime(Long createTime) {
346
421
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
347
422
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
348
423
* </pre>
349
- *
350
424
*/
351
425
public String getMsgType () {
352
426
return this .msgType ;
@@ -555,17 +629,17 @@ public static WxMpXmlMessage fromXml(InputStream is) {
555
629
* @param msgSignature
556
630
*/
557
631
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 ) {
560
634
WxMpCryptUtil cryptUtil = new WxMpCryptUtil (wxMpConfigStorage );
561
635
String plainText = cryptUtil .decrypt (msgSignature , timestamp , nonce ,
562
636
encryptedXml );
563
637
return fromXml (plainText );
564
638
}
565
639
566
640
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 ) {
569
643
try {
570
644
return fromEncryptedXml (IOUtils .toString (is , "UTF-8" ), wxMpConfigStorage ,
571
645
timestamp , nonce , msgSignature );
@@ -719,6 +793,44 @@ public void setFromKfAccount(String fromKfAccount) {
719
793
this .fromKfAccount = fromKfAccount ;
720
794
}
721
795
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
+
722
834
@ XStreamAlias ("ScanCodeInfo" )
723
835
public static class ScanCodeInfo {
724
836
@ Override
0 commit comments