refactor(api): /v1/me 收敛 expire_at → 只发 expires_at(无 web 用户中心)

之前后端同时发 expire_at + expires_at(分别给 app + web 用户中心)。现已无 web 端,
双发是纯冗余,统一只用 expires_at:
- account.go:meResponse 删 ExpireAt 字段 + GetMe handler 不再赋值
- client me.dart:fromJson 删 (expires_at ?? expire_at) 别名回退
- 两端契约快照同步:Go meResponse 冻结集去 expire_at(12→11 key)、删 Dart 别名测试
- 验证:go test httpapi 绿、flutter test contract(14)绿、analyze EXIT 0、e2e 全链路绿

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-25 10:08:50 +08:00
parent dbd183ee00
commit 64f96fe018
4 changed files with 5 additions and 17 deletions
+1 -4
View File
@@ -26,9 +26,7 @@ type meResponse struct {
Email string `json:"email"`
DpUUID string `json:"dp_uuid"`
Plan string `json:"plan"` // "free" | "pro" | "team"
// expire_at kept for the existing app; expires_at is the same value for the
// web user-center (both RFC3339 UTC, null = no active sub).
ExpireAt *string `json:"expire_at"`
// expires_at: RFC3339 UTC, null = no active subscription.
ExpiresAt *string `json:"expires_at"`
// Web user-center fields.
DevicesUsed int `json:"devices_used"`
@@ -120,7 +118,6 @@ func (a *AccountAPI) GetMe(w http.ResponseWriter, r *http.Request) {
}
if expiresAt.Valid {
s := expiresAt.Time.UTC().Format(time.RFC3339)
resp.ExpireAt = &s
resp.ExpiresAt = &s
}
// quota_today_min: null when the plan is unlimited, else remaining minutes.