docs(comments): 注释中文化 · internal/services/channelbridge(纯替换)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 只翻注释/文档字符串:剥掉注释后代码行逐字节不变(机械校验只剩允许的行尾注释形态)
- 术语对齐既有译法(owner→主人、persona→角色、engage→参与度判定、quiet hours→安静时段、backoff→退避)
- 复核:go build 绿 + channelbridge 包测试绿;gofmt 干净
This commit is contained in:
AskaEth committed 2026-10-04 13:33:06 +08:00
1 parent 61cf80d5ee
commit 093f38d986
28 files changed
+1089 -1089

No files matched your search

@@ -13,8 +13,8 @@ import (
var errReload = errors.New("build failed")
// stubFactory returns a fixed adapter set for a platform, so a reload test can
// drive the hot-replace without real network I/O.
// stubFactory 返回某平台的固定适配器集合,使重载测试
// 无需真实网络 I/O 即可驱动热替换。
type stubFactory struct {
adpts []adapter.PlatformAdapter
err error
@@ -65,14 +65,14 @@ func TestReloadReplacesAdapterWithNewConfig(t *testing.T) {
t.Fatalf("Reload: %v", err)
}
// The new adapters are connected and registered.
// 新适配器已连接并注册。
if !newConf0.IsConnected() || !newConf1.IsConnected() {
t.Fatalf("new adapters not connected: conf0=%v conf1=%v", newConf0.IsConnected(), newConf1.IsConnected())
}
if !b.IsConnected("kook:conf0") || !b.IsConnected("kook:conf1") {
t.Fatalf("bridge does not report new adapters connected")
}
// The old adapter instance was disconnected (its read loop stopped).
// 旧适配器实例已断开(其读取循环已停止)。
if old.IsConnected() {
t.Fatal("old adapter should be disconnected after reload")
}
@@ -88,7 +88,7 @@ func TestReloadRemovesRemovedAccount(t *testing.T) {
b.Add(conf1)
b.Start()
// New config only keeps conf1 (conf0 is deleted).
// 新配置只保留 conf1(conf0 被删除)。
factory.adpts = []adapter.PlatformAdapter{
&fakeAdapter{name: "kook:conf1", cfg: map[string]any{"bot_token": "t1b"}},
}