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

@@ -1,9 +1,9 @@
package gateway
// Exercises the per-platform KOOK adapter panel endpoints (design/17 §2). The
// adapter is registered through a wrapper that embeds adapter.PlatformAdapter —
// mirroring cmd/cyrene's namedAdapter — so these tests also cover the reflection
// unwrap the gateway uses to reach the concrete *kook.Adapter.
// 演练按平台的 KOOK 适配器面板端点(design/17 §2)。适配器
// 经由一个内嵌 adapter.PlatformAdapter 的包装器注册 —— 仿照
// cmd/cyrene 的 namedAdapter —— 因此这些测试也覆盖网关用来
// 抵达具体 *kook.Adapter 的反射拆包。
import (
"encoding/json"
@@ -23,8 +23,8 @@ func gatewayKookLogger() *slog.Logger {
return slog.New(slog.NewTextHandler(io.Discard, nil))
}
// gatewayKookWrap embeds adapter.PlatformAdapter the way cmd/cyrene's namedAdapter
// does, so the gateway's reflection-based unwrap (asKookAdmin) is exercised.
// gatewayKookWrap 按 cmd/cyrene 的 namedAdapter 的方式内嵌
// adapter.PlatformAdapter,从而演练网关基于反射的拆包(asKookAdmin)。
type gatewayKookWrap struct {
adapter.PlatformAdapter
name string
@@ -32,7 +32,7 @@ type gatewayKookWrap struct {
func (w *gatewayKookWrap) Name() string { return w.name }
// gatewayKookServer answers the KOOK REST surface a panel view touches.
// gatewayKookServer 应答面板视图会触及的 KOOK REST 表面。
func gatewayKookServer(t *testing.T) *httptest.Server {
t.Helper()
h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -71,8 +71,8 @@ func gatewayKookServer(t *testing.T) *httptest.Server {
return srv
}
// newKookGateway wires a registry whose kook channel wraps a real adapter pointed
// at an httptest KOOK server, and returns the owner JWT.
// newKookGateway 接线一个注册表,其 kook 渠道包装一个指向 httptest
// KOOK 服务器的真实适配器,并返回 owner JWT。
func newKookGateway(t *testing.T, name string) (string, string) {
t.Helper()
kookSrv := gatewayKookServer(t)