pub struct WxOpenXmlMessage {Show 28 fields
pub app_id: Option<String>,
pub create_time: Option<i64>,
pub info_type: Option<String>,
pub component_verify_ticket: Option<String>,
pub authorizer_appid: Option<String>,
pub authorization_code: Option<String>,
pub authorization_code_expired_time: Option<i64>,
pub pre_auth_code: Option<String>,
pub sub_app_id: Option<String>,
pub status: Option<i32>,
pub auth_code: Option<String>,
pub msg: Option<String>,
pub info: Info,
pub task_id: Option<String>,
pub task_status: Option<i32>,
pub apply_status: Option<i32>,
pub message: Option<String>,
pub dispatch_info: Option<DispatchInfo>,
pub expired: Option<i64>,
pub icp_verify_task_id: Option<String>,
pub verify_app_id: Option<String>,
pub result: Option<i32>,
pub along_with_auth_result: Option<i32>,
pub beian_authorizer_app_id: Option<String>,
pub beian_status: Option<i32>,
pub procedure_id: Option<String>,
pub procedure_status: Option<i32>,
pub context: Option<String>,
}Expand description
第三方平台推送消息。
元素名与 Java @XStreamAlias 一一对应;context 为原始明文
(from_encrypted_xml 回填,非 XML 元素)。
Fields§
§app_id: Option<String>第三方平台的APPID。
create_time: Option<i64>消息创建时间。
info_type: Option<String>消息类型(verify_ticket / authorized / unauthorized / updateauthorized / notify_third_fasteregister / notify_3rd_wxa_auth 等)。
component_verify_ticket: Option<String>第三方平台 component_verify_ticket(票据,5 分钟推送一次)。
授权方 appid(authorized/updateauthorized/unauthorized 事件)。
授权码(authorized 事件,换取授权信息)。
授权码过期时间(秒)。
pre_auth_code: Option<String>预授权码。
sub_app_id: Option<String>子平台APPID(公众号/小程序的APPID)——快速创建小程序、小程序认证中。
status: Option<i32>快速创建小程序接口推送的状态(对应 Java status)。
auth_code: Option<String>快速创建小程序的 auth_code。
msg: Option<String>快速创建小程序推送的消息。
info: Info快速创建小程序推送的信息。
task_id: Option<String>小程序认证(年审)任务ID。
task_status: Option<i32>认证任务状态:0初始 1超24小时 2用户拒绝 3用户同意 4发起人脸 5人脸失败 6人脸ok 7人脸认证后手机验证码 8手机验证失败 9手机验证成功 11创建审核单失败 12创建审核单成功 14验证失败 15等待支付。
apply_status: Option<i32>审核单状态,创建审核单成功后有效:0审核单不存在 1待支付 2审核中 3打回重填 4认证通过 5认证最终失败(不能再修改)。
message: Option<String>审核消息或失败原因。
dispatch_info: Option<DispatchInfo>审核提供商分配信息。
expired: Option<i64>小程序认证(年审)即将到期通知的过期时间戳(秒数)。
icp_verify_task_id: Option<String>人脸核验任务id(infoType=notify_icpfiling_verify_result)。
verify_app_id: Option<String>小程序唯一id。
result: Option<i32>人脸核验结果:2-核验失败;3-核验成功。
along_with_auth_result: Option<i32>发起时 along_with_auth 填 true 时有效:9. 认证短信核验通过。
小程序唯一id(备案审核被驳回/通过事件 notify_apply_icpfiling_result)。
beian_status: Option<i32>备案状态,参考“获取小程序备案状态及驳回原因”接口的备案状态枚举。
procedure_id: Option<String>小程序认证及备案任务流程id(notify_3rd_wxa_auth_and_icp)。
procedure_status: Option<i32>任务流程状态:9手机验证成功 15等待支付 16支付成功 17认证审核中 18认证审核驳回 19认证审核通过 20认证最终失败 21创建备案审核单失败 22备案平台审核中 23备案平台审核驳回 24备案管局审核中 25管局审核驳回 26认证及备案完成 27流程已过期 28流程已终止 29备案已撤回。
context: Option<String>原始通知内容(由 from_encrypted_xml 回填,
非 XML 元素)。
Implementations§
Source§impl WxOpenXmlMessage
impl WxOpenXmlMessage
Sourcepub fn from_xml(xml: &str) -> Result<Self, String>
pub fn from_xml(xml: &str) -> Result<Self, String>
从明文 xml 解析消息。
对应 Java fromXml(String):先修正微信变态的消息内容格式
(</PicList><PicList> 相邻闭合/开启,open 消息中为无操作),
再以 quick-xml serde 按 @XStreamAlias 元素名映射字段。
Sourcepub fn from_encrypted_xml(
encrypted_xml: &str,
config: &dyn WxOpenConfigStorage,
timestamp: &str,
nonce: &str,
msg_signature: &str,
) -> Result<Self, String>
pub fn from_encrypted_xml( encrypted_xml: &str, config: &dyn WxOpenConfigStorage, timestamp: &str, nonce: &str, msg_signature: &str, ) -> Result<Self, String>
从加密字符串转换(第三方平台回调消息解密入口)。
对应 Java fromEncryptedXml(String, WxOpenConfigStorage, String, String, String):WxOpenCryptUtils 验签并 AES 解密(Wave 0 已实现),
解密为空时返回错误,解析后回填原始明文到 context。
Sourcepub fn from_encrypted_mp_xml(
encrypted_xml: &str,
config: &dyn WxOpenConfigStorage,
timestamp: &str,
nonce: &str,
msg_signature: &str,
) -> Result<String, String>
pub fn from_encrypted_mp_xml( encrypted_xml: &str, config: &dyn WxOpenConfigStorage, timestamp: &str, nonce: &str, msg_signature: &str, ) -> Result<String, String>
解密第三方平台推送的公众号消息回调。
对应 Java fromEncryptedMpXml(...)(返回 WxMpXmlMessage)。
ADAPTED:wx-rust-open 尚未依赖 wx-rust-mp,此处返回解密后的明文
XML 字符串,由调用方交给 wx_rust_mp::bean::message::WxMpXmlMessage:: from_xml 解析;Wave 2 引入跨 crate 依赖后换为返回 WxMpXmlMessage。
Trait Implementations§
Source§impl Clone for WxOpenXmlMessage
impl Clone for WxOpenXmlMessage
Source§fn clone(&self) -> WxOpenXmlMessage
fn clone(&self) -> WxOpenXmlMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more