diff --git a/server-rs/crates/api-server/src/runtime_profile.rs b/server-rs/crates/api-server/src/runtime_profile.rs index 13ff54860..8e88dcfe9 100644 --- a/server-rs/crates/api-server/src/runtime_profile.rs +++ b/server-rs/crates/api-server/src/runtime_profile.rs @@ -1914,7 +1914,7 @@ fn build_profile_recharge_center_response( ProfileRechargeCenterResponse { mud_point_balance, membership: ProfileMembershipResponse { - status: record.membership.status.as_str().to_string(), + status: record.membership.status.into(), plan: record.membership.plan.into(), started_at: record.membership.started_at, expires_at: record.membership.expires_at, diff --git a/server-rs/crates/shared-contracts/src/runtime.rs b/server-rs/crates/shared-contracts/src/runtime.rs index 6de475871..be73898d7 100644 --- a/server-rs/crates/shared-contracts/src/runtime.rs +++ b/server-rs/crates/shared-contracts/src/runtime.rs @@ -433,7 +433,8 @@ pub struct ProfileMembershipPlanResponse { #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct ProfileMembershipResponse { - pub status: String, + /// 会员状态 token:`normal` / `active`。 + pub status: ProfileMembershipStatusToken, /// 当前档位 token;非会员与已到期都是 `normal`。 pub plan: ProfileMembershipPlanToken, pub started_at: Option, @@ -1819,7 +1820,7 @@ mod tests { permanent_points: 4, }, membership: ProfileMembershipResponse { - status: "active".to_string(), + status: ProfileMembershipStatusToken::Active, plan: ProfileMembershipPlanToken::Plus, started_at: Some("2026-04-25T10:00:00Z".to_string()), expires_at: Some("2026-05-25T10:00:00Z".to_string()), @@ -1929,7 +1930,7 @@ mod tests { let center = ProfileRechargeCenterResponse { mud_point_balance: empty_mud_point_balance(), membership: ProfileMembershipResponse { - status: "normal".to_string(), + status: ProfileMembershipStatusToken::Normal, plan: ProfileMembershipPlanToken::Normal, started_at: None, expires_at: None, @@ -2005,7 +2006,7 @@ mod tests { let center = ProfileRechargeCenterResponse { mud_point_balance: empty_mud_point_balance(), membership: ProfileMembershipResponse { - status: "normal".to_string(), + status: ProfileMembershipStatusToken::Normal, plan: ProfileMembershipPlanToken::Normal, started_at: None, expires_at: None,