重构(会员契约): 会员结构体改用 ts-rs 生成类型
- shared-contracts 为 10 个会员结构体补 ts_rs::TS / ts(export),64 位整数字段补 ts(type = "number") 对齐前端 number - 新增 10 个生成绑定;packages/shared 与 admin-web 改为 re-export 生成类型,仅 kind / status 等前端收窄联合用 Omit 组合保留 - 同步设计文档 §2.5 与决策日志
This commit is contained in:
@@ -160,6 +160,14 @@ pub struct ProfileMembershipPlan {
|
||||
避免 AGC Tauri shell 等 Rust 客户端因后端新增一个 token 就整包解析失败(权益与下单金额仍以后端重算为准)。
|
||||
这 5 个 token 枚举统一 `#[cfg_attr(feature = "ts-bindings", derive(ts_rs::TS))]`
|
||||
导出到 `packages/shared/src/contracts/generated/`,前端只 re-export,不再手写字符串联合类型。
|
||||
- **会员结构体也走生成类型(2026-10-03 补)**:`ProfileMembershipPlanResponse` / `ProfileMembershipResponse` /
|
||||
`ProfileRechargeProductResponse` / `ProfileRechargeOrderResponse` / `ProfileRechargeCenterResponse` /
|
||||
`ProfileMembershipUpgradeQuoteResponse` / `ProfileMembershipPlanAdminListResponse` /
|
||||
`AdminUpsertProfileMembershipPlanRequest` / `ProfileDailyFreePointsResponse` /
|
||||
`ProfileMembershipUpgradeQuoteRequest` 同样 `ts(export)`;64 位整数字段补 `ts(type = "number")`
|
||||
对齐前端 `number`(ts-rs 默认 `bigint`)。`packages/shared/src/contracts/runtime.ts` 与
|
||||
`apps/admin-web/src/api/adminApiTypes.ts` 改为 re-export 生成类型,只手写保留 `kind` / `status`
|
||||
这类前端收窄联合(用 `Omit` 组合),`ProfileRechargeCenterResponse` 同理收窄内层商品 / 订单数组。
|
||||
- **删除** `RuntimeProfileMembershipTier { Normal, Month, Season, Year, Starter, Basic, Pro, Ultimate }`
|
||||
及其 `as_str()`(会员侧零存量,用户已授权破坏性变更)。
|
||||
- `RuntimeProfileWalletLedgerSourceType` **末尾追加** `MembershipUpgradeGrant`
|
||||
|
||||
Reference in New Issue
Block a user