pub struct TokenStateQuery {
pub app_id: Option<String>,
}Expand description
v1.4.98 T2-8 (mobile-source-audit Phase 2): NN+MM token 状态查询.
POST /api/token-state (无 body / 可选 {"c2s":{"app_id":"nn"|"mm"|"all"}}).
GET /api/token-state?app_id=nn|mm|all — query param 同样可指定.
返 NN (Futu Token app) + MM (moomoo Token app) 两边 token 启用 + 绑定 4 字段 (1=已绑定/已启用, 0=未绑定/未启用).
Use case: pitfall #15 “moomoo token = 富途令牌的海外版本” 实证后, 用户
调 /api/unlock-trade 失败 -20011 时, 第一线诊断: curl /api/token-state 看
双系绑定情况, 决定 TOTP secret 该来自哪个 app.
codex 2026-04-27 audit fix: 之前 docstring 声称支持 ?app_id=nn 但
handler 只接 body 不读 query, 真机调 GET ?app_id=nn → app_id=“all” silent
错. 加 Query extractor map → c2s.app_id 真传到 backend.
真机 verify: T2-8 自测 PASS (NN/MM 4 字段返).
v1.4.99 codex F5 fix (P2, 2026-04-27): deny_unknown_fields —
之前 typo ?app_idd=nn silent 默认到 all (typo 字段被忽略, 走 daemon
default). strict-fields middleware 只对 POST body 跑, GET query 不被
验证. 加 deny_unknown_fields 让 typo 立即返 400, 与 POST 表面对齐.
(per pitfall #45 silent-success anti-pattern, 子模式: silent default).
Fields§
§app_id: Option<String>app_id filter: “nn” | “mm” | “all” (default “all”)
Trait Implementations§
Source§impl Debug for TokenStateQuery
impl Debug for TokenStateQuery
Source§impl Default for TokenStateQuery
impl Default for TokenStateQuery
Source§fn default() -> TokenStateQuery
fn default() -> TokenStateQuery
Source§impl<'de> Deserialize<'de> for TokenStateQuery
impl<'de> Deserialize<'de> for TokenStateQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TokenStateQuery
impl RefUnwindSafe for TokenStateQuery
impl Send for TokenStateQuery
impl Sync for TokenStateQuery
impl Unpin for TokenStateQuery
impl UnsafeUnpin for TokenStateQuery
impl UnwindSafe for TokenStateQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more