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:
@@ -6,8 +6,8 @@ package httpapi
|
||||
// 同步客户端 model + 文档,避免控制面与客户端悄悄分叉。
|
||||
//
|
||||
// ⚠️ 与客户端冻结集对账:client/test/contract/api_contract_test.dart 的 _frozenMeKeys
|
||||
// (9 个)。后端这里多发 uuid / dp_uuid,且同时发 expire_at + expires_at(别名):客户端
|
||||
// 故意忽略 uuid/dp_uuid、把 expire_at 当 expires_at 的回退。改任一端都要回看另一端。
|
||||
// (9 个)。后端这里多发 uuid / dp_uuid(客户端故意忽略);expire_at 已废弃移除——
|
||||
// 无 web 用户中心后,两端统一只用 expires_at。改任一端都要回看另一端。
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
@@ -54,8 +54,7 @@ func assertFrozenKeys(t *testing.T, name string, got map[string]struct{}, want .
|
||||
|
||||
func TestContractMeResponse(t *testing.T) {
|
||||
assertFrozenKeys(t, "/v1/me", jsonTagSet(meResponse{}),
|
||||
"uuid", "email", "dp_uuid", "plan",
|
||||
"expire_at", "expires_at",
|
||||
"uuid", "email", "dp_uuid", "plan", "expires_at",
|
||||
"devices_used", "devices_max",
|
||||
"quota_today_min", "data_today_gb", "weekly_gb", "totp_enabled",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user