mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 16:18:51 +08:00
commit
fd4505d606
@ -18,8 +18,13 @@ public class WxConsts {
|
|||||||
public static final String XML_MSG_LOCATION = "location";
|
public static final String XML_MSG_LOCATION = "location";
|
||||||
public static final String XML_MSG_LINK = "link";
|
public static final String XML_MSG_LINK = "link";
|
||||||
public static final String XML_MSG_EVENT = "event";
|
public static final String XML_MSG_EVENT = "event";
|
||||||
|
public static final String XML_MSG_DEVICE_TEXT = "device_text";
|
||||||
|
public static final String XML_MSG_DEVICE_EVENT = "device_event";
|
||||||
|
public static final String XML_MSG_DEVICE_STATUS = "device_status";
|
||||||
|
public static final String XML_MSG_HARDWARE = "hardware";
|
||||||
public static final String XML_TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
|
public static final String XML_TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
|
||||||
|
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
// 主动发送消息(即客服消息)的消息类型
|
// 主动发送消息(即客服消息)的消息类型
|
||||||
///////////////////////
|
///////////////////////
|
||||||
|
@ -263,6 +263,81 @@ public class WxMpXmlMessage implements Serializable {
|
|||||||
@XStreamAlias("FailReason")
|
@XStreamAlias("FailReason")
|
||||||
private String failReason;
|
private String failReason;
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////
|
||||||
|
// 微信硬件平台相关事件推送
|
||||||
|
///////////////////////////////////////
|
||||||
|
/**
|
||||||
|
* 设备类型,目前为"公众账号原始ID"
|
||||||
|
*/
|
||||||
|
@XStreamAlias("DeviceType")
|
||||||
|
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ID,第三方提供
|
||||||
|
*/
|
||||||
|
@XStreamAlias("DeviceId")
|
||||||
|
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
|
||||||
|
@XStreamAlias("HardWare")
|
||||||
|
private HardWare hardWare = new HardWare();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求类型:0:退订设备状态;1:心跳;(心跳的处理方式跟订阅一样)2:订阅设备状态
|
||||||
|
*/
|
||||||
|
@XStreamAlias("OpType")
|
||||||
|
private Integer opType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态:0:未连接;1:已连接
|
||||||
|
*/
|
||||||
|
@XStreamAlias("DeviceStatus")
|
||||||
|
private Integer deviceStatus;
|
||||||
|
|
||||||
|
public Integer getOpType() {
|
||||||
|
return opType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpType(Integer opType) {
|
||||||
|
this.opType = opType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDeviceStatus() {
|
||||||
|
|
||||||
|
return deviceStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceStatus(Integer deviceStatus) {
|
||||||
|
this.deviceStatus = deviceStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HardWare getHardWare() {
|
||||||
|
return hardWare;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHardWare(HardWare hardWare) {
|
||||||
|
this.hardWare = hardWare;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceType() {
|
||||||
|
return deviceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceType(String deviceType) {
|
||||||
|
this.deviceType = deviceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(String deviceId) {
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getExpiredTime() {
|
public Long getExpiredTime() {
|
||||||
return this.expiredTime;
|
return this.expiredTime;
|
||||||
}
|
}
|
||||||
@ -346,7 +421,6 @@ public class WxMpXmlMessage implements Serializable {
|
|||||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
|
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
|
||||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
|
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getMsgType() {
|
public String getMsgType() {
|
||||||
return this.msgType;
|
return this.msgType;
|
||||||
@ -555,8 +629,8 @@ public class WxMpXmlMessage implements Serializable {
|
|||||||
* @param msgSignature
|
* @param msgSignature
|
||||||
*/
|
*/
|
||||||
public static WxMpXmlMessage fromEncryptedXml(String encryptedXml,
|
public static WxMpXmlMessage fromEncryptedXml(String encryptedXml,
|
||||||
WxMpConfigStorage wxMpConfigStorage, String timestamp, String nonce,
|
WxMpConfigStorage wxMpConfigStorage, String timestamp, String nonce,
|
||||||
String msgSignature) {
|
String msgSignature) {
|
||||||
WxMpCryptUtil cryptUtil = new WxMpCryptUtil(wxMpConfigStorage);
|
WxMpCryptUtil cryptUtil = new WxMpCryptUtil(wxMpConfigStorage);
|
||||||
String plainText = cryptUtil.decrypt(msgSignature, timestamp, nonce,
|
String plainText = cryptUtil.decrypt(msgSignature, timestamp, nonce,
|
||||||
encryptedXml);
|
encryptedXml);
|
||||||
@ -564,8 +638,8 @@ public class WxMpXmlMessage implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static WxMpXmlMessage fromEncryptedXml(InputStream is,
|
public static WxMpXmlMessage fromEncryptedXml(InputStream is,
|
||||||
WxMpConfigStorage wxMpConfigStorage, String timestamp, String nonce,
|
WxMpConfigStorage wxMpConfigStorage, String timestamp, String nonce,
|
||||||
String msgSignature) {
|
String msgSignature) {
|
||||||
try {
|
try {
|
||||||
return fromEncryptedXml(IOUtils.toString(is, "UTF-8"), wxMpConfigStorage,
|
return fromEncryptedXml(IOUtils.toString(is, "UTF-8"), wxMpConfigStorage,
|
||||||
timestamp, nonce, msgSignature);
|
timestamp, nonce, msgSignature);
|
||||||
@ -719,6 +793,44 @@ public class WxMpXmlMessage implements Serializable {
|
|||||||
this.fromKfAccount = fromKfAccount;
|
this.fromKfAccount = fromKfAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XStreamAlias("HardWare")
|
||||||
|
public static class HardWare {
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return ToStringUtils.toSimpleString(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息展示,目前支持myrank(排行榜)
|
||||||
|
*/
|
||||||
|
@XStreamAlias("MessageView")
|
||||||
|
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||||
|
private String messageView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息点击动作,目前支持ranklist(点击跳转排行榜)
|
||||||
|
*/
|
||||||
|
@XStreamAlias("MessageAction")
|
||||||
|
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||||
|
private String messageAction;
|
||||||
|
|
||||||
|
public String getMessageView() {
|
||||||
|
return messageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessageView(String messageView) {
|
||||||
|
this.messageView = messageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessageAction() {
|
||||||
|
return messageAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessageAction(String messageAction) {
|
||||||
|
this.messageAction = messageAction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@XStreamAlias("ScanCodeInfo")
|
@XStreamAlias("ScanCodeInfo")
|
||||||
public static class ScanCodeInfo {
|
public static class ScanCodeInfo {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user