fix: 应用 xhigh 代码评审的跨端修复
来自 xhigh code review 的正确性/健壮性修复,覆盖全部五端: - server:鉴权 fail-closed、计量交叉校验与配额扣穿处理、WS 网关并发与关闭顺序、 billing 行锁、redis Lua 过期与设备槽刷新、config 解析 - desktop:会话 epoch 防串话、WS 重连与 401 处理、api 客户端复用、统一 usePoll 轮询 - android:握手时序、请求头封装、账户状态派生、按需重组 - ios:finalize 宽限、串行采集、错误文案服务端优先、删除死代码 CommitController Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -52,10 +52,12 @@ type ServerMsg struct {
|
||||
// partial / final
|
||||
Text string `json:"text,omitempty"`
|
||||
|
||||
// usage:识别中每 2s 及 stop 后下发,驱动 UI 实时刷新余额
|
||||
SessionSeconds int `json:"session_seconds,omitempty"`
|
||||
BalanceSeconds int64 `json:"balance_seconds,omitempty"`
|
||||
TrialRemaining int `json:"trial_remaining,omitempty"`
|
||||
// usage:识别中每 2s 及 stop 后下发,驱动 UI 实时刷新余额。
|
||||
// 去 omitempty(16G):0 是合法值(扣穿 / 试用用尽),客户端须能区分
|
||||
// "未下发"与"为 0"。partial/final 帧亦会带这三个 0 字段,客户端以 type 分发,无碍。
|
||||
SessionSeconds int `json:"session_seconds"`
|
||||
BalanceSeconds int64 `json:"balance_seconds"`
|
||||
TrialRemaining int `json:"trial_remaining"`
|
||||
|
||||
// error
|
||||
Code string `json:"code,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user