@@ -297,6 +297,43 @@ public class WxMpXmlMessage implements Serializable {
297
297
@ XStreamAlias ("DeviceStatus" )
298
298
private Integer deviceStatus ;
299
299
300
+ public static WxMpXmlMessage fromXml (String xml ) {
301
+ return XStreamTransformer .fromXml (WxMpXmlMessage .class , xml );
302
+ }
303
+
304
+ public static WxMpXmlMessage fromXml (InputStream is ) {
305
+ return XStreamTransformer .fromXml (WxMpXmlMessage .class , is );
306
+ }
307
+
308
+ /**
309
+ * 从加密字符串转换
310
+ *
311
+ * @param encryptedXml
312
+ * @param wxMpConfigStorage
313
+ * @param timestamp
314
+ * @param nonce
315
+ * @param msgSignature
316
+ */
317
+ public static WxMpXmlMessage fromEncryptedXml (String encryptedXml ,
318
+ WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
319
+ String msgSignature ) {
320
+ WxMpCryptUtil cryptUtil = new WxMpCryptUtil (wxMpConfigStorage );
321
+ String plainText = cryptUtil .decrypt (msgSignature , timestamp , nonce ,
322
+ encryptedXml );
323
+ return fromXml (plainText );
324
+ }
325
+
326
+ public static WxMpXmlMessage fromEncryptedXml (InputStream is ,
327
+ WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
328
+ String msgSignature ) {
329
+ try {
330
+ return fromEncryptedXml (IOUtils .toString (is , "UTF-8" ), wxMpConfigStorage ,
331
+ timestamp , nonce , msgSignature );
332
+ } catch (IOException e ) {
333
+ throw new RuntimeException (e );
334
+ }
335
+ }
336
+
300
337
public Integer getOpType () {
301
338
return opType ;
302
339
}
@@ -611,43 +648,6 @@ public void setFromUser(String fromUser) {
611
648
this .fromUser = fromUser ;
612
649
}
613
650
614
- public static WxMpXmlMessage fromXml (String xml ) {
615
- return XStreamTransformer .fromXml (WxMpXmlMessage .class , xml );
616
- }
617
-
618
- public static WxMpXmlMessage fromXml (InputStream is ) {
619
- return XStreamTransformer .fromXml (WxMpXmlMessage .class , is );
620
- }
621
-
622
- /**
623
- * 从加密字符串转换
624
- *
625
- * @param encryptedXml
626
- * @param wxMpConfigStorage
627
- * @param timestamp
628
- * @param nonce
629
- * @param msgSignature
630
- */
631
- public static WxMpXmlMessage fromEncryptedXml (String encryptedXml ,
632
- WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
633
- String msgSignature ) {
634
- WxMpCryptUtil cryptUtil = new WxMpCryptUtil (wxMpConfigStorage );
635
- String plainText = cryptUtil .decrypt (msgSignature , timestamp , nonce ,
636
- encryptedXml );
637
- return fromXml (plainText );
638
- }
639
-
640
- public static WxMpXmlMessage fromEncryptedXml (InputStream is ,
641
- WxMpConfigStorage wxMpConfigStorage , String timestamp , String nonce ,
642
- String msgSignature ) {
643
- try {
644
- return fromEncryptedXml (IOUtils .toString (is , "UTF-8" ), wxMpConfigStorage ,
645
- timestamp , nonce , msgSignature );
646
- } catch (IOException e ) {
647
- throw new RuntimeException (e );
648
- }
649
- }
650
-
651
651
public String getStatus () {
652
652
return this .status ;
653
653
}
@@ -757,7 +757,7 @@ public WxMpXmlMessage.SendLocationInfo getSendLocationInfo() {
757
757
}
758
758
759
759
public void setSendLocationInfo (
760
- WxMpXmlMessage .SendLocationInfo sendLocationInfo ) {
760
+ WxMpXmlMessage .SendLocationInfo sendLocationInfo ) {
761
761
this .sendLocationInfo = sendLocationInfo ;
762
762
}
763
763
@@ -793,27 +793,31 @@ public void setFromKfAccount(String fromKfAccount) {
793
793
this .fromKfAccount = fromKfAccount ;
794
794
}
795
795
796
+ @ Override
797
+ public String toString () {
798
+ return ToStringUtils .toSimpleString (this );
799
+ }
800
+
796
801
@ XStreamAlias ("HardWare" )
797
802
public static class HardWare {
798
- @ Override
799
- public String toString () {
800
- return ToStringUtils .toSimpleString (this );
801
- }
802
-
803
803
/**
804
804
* 消息展示,目前支持myrank(排行榜)
805
805
*/
806
806
@ XStreamAlias ("MessageView" )
807
807
@ XStreamConverter (value = XStreamCDataConverter .class )
808
808
private String messageView ;
809
-
810
809
/**
811
810
* 消息点击动作,目前支持ranklist(点击跳转排行榜)
812
811
*/
813
812
@ XStreamAlias ("MessageAction" )
814
813
@ XStreamConverter (value = XStreamCDataConverter .class )
815
814
private String messageAction ;
816
815
816
+ @ Override
817
+ public String toString () {
818
+ return ToStringUtils .toSimpleString (this );
819
+ }
820
+
817
821
public String getMessageView () {
818
822
return messageView ;
819
823
}
@@ -833,19 +837,18 @@ public void setMessageAction(String messageAction) {
833
837
834
838
@ XStreamAlias ("ScanCodeInfo" )
835
839
public static class ScanCodeInfo {
836
- @ Override
837
- public String toString () {
838
- return ToStringUtils .toSimpleString (this );
839
- }
840
-
841
840
@ XStreamAlias ("ScanType" )
842
841
@ XStreamConverter (value = XStreamCDataConverter .class )
843
842
private String scanType ;
844
-
845
843
@ XStreamAlias ("ScanResult" )
846
844
@ XStreamConverter (value = XStreamCDataConverter .class )
847
845
private String scanResult ;
848
846
847
+ @ Override
848
+ public String toString () {
849
+ return ToStringUtils .toSimpleString (this );
850
+ }
851
+
849
852
/**
850
853
* 扫描类型,一般是qrcode
851
854
*/
@@ -873,17 +876,16 @@ public void setScanResult(String scanResult) {
873
876
874
877
@ XStreamAlias ("SendPicsInfo" )
875
878
public static class SendPicsInfo {
879
+ @ XStreamAlias ("PicList" )
880
+ protected final List <Item > picList = new ArrayList <>();
881
+ @ XStreamAlias ("Count" )
882
+ private Long count ;
883
+
876
884
@ Override
877
885
public String toString () {
878
886
return ToStringUtils .toSimpleString (this );
879
887
}
880
888
881
- @ XStreamAlias ("Count" )
882
- private Long count ;
883
-
884
- @ XStreamAlias ("PicList" )
885
- protected final List <Item > picList = new ArrayList <>();
886
-
887
889
public Long getCount () {
888
890
return this .count ;
889
891
}
@@ -898,15 +900,15 @@ public List<Item> getPicList() {
898
900
899
901
@ XStreamAlias ("item" )
900
902
public static class Item {
903
+ @ XStreamAlias ("PicMd5Sum" )
904
+ @ XStreamConverter (value = XStreamCDataConverter .class )
905
+ private String picMd5Sum ;
906
+
901
907
@ Override
902
908
public String toString () {
903
909
return ToStringUtils .toSimpleString (this );
904
910
}
905
911
906
- @ XStreamAlias ("PicMd5Sum" )
907
- @ XStreamConverter (value = XStreamCDataConverter .class )
908
- private String picMd5Sum ;
909
-
910
912
public String getPicMd5Sum () {
911
913
return this .picMd5Sum ;
912
914
}
@@ -985,9 +987,4 @@ public void setPoiname(String poiname) {
985
987
this .poiname = poiname ;
986
988
}
987
989
}
988
-
989
- @ Override
990
- public String toString () {
991
- return ToStringUtils .toSimpleString (this );
992
- }
993
990
}
0 commit comments