Skip to main content

WxOpenXmlMessage

Struct WxOpenXmlMessage 

Source
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 分钟推送一次)。

§authorizer_appid: Option<String>

授权方 appid(authorized/updateauthorized/unauthorized 事件)。

§authorization_code: Option<String>

授权码(authorized 事件,换取授权信息)。

§authorization_code_expired_time: Option<i64>

授权码过期时间(秒)。

§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. 认证短信核验通过。

§beian_authorizer_app_id: Option<String>

小程序唯一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

Source

pub fn from_xml(xml: &str) -> Result<Self, String>

从明文 xml 解析消息。

对应 Java fromXml(String):先修正微信变态的消息内容格式 (</PicList><PicList> 相邻闭合/开启,open 消息中为无操作), 再以 quick-xml serde 按 @XStreamAlias 元素名映射字段。

Source

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

Source

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

Source§

fn clone(&self) -> WxOpenXmlMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WxOpenXmlMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WxOpenXmlMessage

Source§

fn default() -> WxOpenXmlMessage

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WxOpenXmlMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for WxOpenXmlMessage

Source§

fn eq(&self, other: &WxOpenXmlMessage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WxOpenXmlMessage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more