docs(comments): 注释中文化 · internal/runtime/history(15 文件,纯替换)
- 只翻注释/文档字符串:剥离注释后代码行逐字节不变(机械校验只剩 4 条行尾注释的翻译,代码前缀全等) - 交叉引用(design/16 §4.6、D4/B3、0010 迁移文件名)逐字保留 - 保留未译技术词:DDL/rowid/LIKE/LEFT JOIN/DTO/rune/WS/actor 及全部标识符与表名 - 顺带副作用:store.go、session_persona_test.go 由注释文字改变而变得 gofmt 干净(未运行 gofmt -w)
This commit is contained in:
1 parent
b0fbb8bc0d
commit
09fba77f87
15 files changed
+430
-516
No files matched your search
@@ -5,10 +5,9 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// SetPinned pins or unpins a persistent session. Pinning is display/order metadata
|
||||
// only (like the title): both the fixed main session and sub sessions may be pinned,
|
||||
// and identity/permissions never derive from it. An unknown id returns
|
||||
// ErrSessionNotFound.
|
||||
// SetPinned 置顶或取消置顶一个持久化会话。置顶只是展示/排序元数据(与标题
|
||||
// 一样):固定主会话与子会话都可置顶,身份/权限绝不由它推导。未知 id 返回
|
||||
// ErrSessionNotFound。
|
||||
func (s *Store) SetPinned(ctx context.Context, sessionID string, pinned bool) error {
|
||||
res, err := s.db.ExecContext(ctx, `UPDATE chat_sessions SET pinned = ? WHERE id = ?`, pinnedValue(pinned), sessionID)
|
||||
if err != nil {
|
||||
@@ -24,7 +23,7 @@ func (s *Store) SetPinned(ctx context.Context, sessionID string, pinned bool) er
|
||||
return nil
|
||||
}
|
||||
|
||||
// pinnedValue maps the boolean to SQLite's 0/1 integer representation.
|
||||
// pinnedValue 把布尔值映射为 SQLite 的 0/1 整数表示。
|
||||
func pinnedValue(pinned bool) int {
|
||||
if pinned {
|
||||
return 1
|
||||
|
||||
Reference in new issue
Block a user