docs(gateway): gateway 剩余文件注释改中文(逐行 1:1,代码零字节改动)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

主人 2026-10-03 拍板「注释一律中文」;gateway 至此整包注释中文化完成(本会话共 3 批:
已推库 16 个文件 + 本批剩余文件)。
校验:机械校验(非注释改动行)= 空;剥注释后代码文本逐行比对全等(不一致文件数 0);
全树 go test ./... 58 包 ok / 0 FAIL;交叉编译绿。
This commit is contained in:
AskaEth committed 2026-10-03 22:28:25 +08:00
1 parent 91e8d7a029
commit 074ffc4ebf
73 files changed
+2529 -2529

No files matched your search

@@ -9,10 +9,10 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/history"
)
// TestHistorySessionsLastMessage asserts the GET /api/v1/sessions wire contract for the
// last-message preview (B3): every session carries lastMessage {role,content,createdAt}
// with the newest message's whitespace-collapsed content, and a message-less session
// omits the field.
// TestHistorySessionsLastMessage 断言 GET /api/v1/sessions 中最后消息预览的
// 线上契约(B3):每个会话都携带 lastMessage {role,content,createdAt},
// 其 content 是折叠空白后的最新消息内容,而没有消息的会话
// 省略该字段。
func TestHistorySessionsLastMessage(t *testing.T) {
t.Parallel()
_, ts, jwt, st := newHistoryEnv(t)
@@ -33,8 +33,8 @@ func TestHistorySessionsLastMessage(t *testing.T) {
if resp.StatusCode != http.StatusOK {
t.Fatalf("status = %d, want 200 (body=%s)", resp.StatusCode, body)
}
// Decode into a JSON-tagged shape so the wire contract (key names) is asserted,
// not just the in-package struct.
// 解码进带 JSON 标签的形状,因此断言的是线上契约(键名),
// 而不只是包内结构体。
var sessions []struct {
ID string `json:"id"`
LastMessage *struct {
@@ -51,7 +51,7 @@ func TestHistorySessionsLastMessage(t *testing.T) {
if main == nil || main.Role != history.RoleAssistant || main.Content != "在的 请说" || main.CreatedAt != 2000 {
t.Fatalf("main lastMessage = %+v, want assistant/在的 请说/2000", main)
}
// The empty sub session omits lastMessage entirely.
// 空的子会话完全省略 lastMessage。
if sessions[1].ID != sub {
t.Fatalf("sessions[1].id = %q, want %q", sessions[1].ID, sub)
}