Files
Atlas/internal/store/sessions.go
T
renjue f26f334a2d
CI / docker (push) Failing after 2m7s
实现 Atlas AI 平台一期能力并完成品牌化改造。
引入用户端对话/生图与管理端 Provider 配置,统一 invoke 编排、Gateway、请求日志与模型管理;前端按设计规范拆分布局,Go module 更名为 github.com/rose_cat707/Atlas;生图长任务进度改为 SSE 推送,后端仍轮询上游。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 20:18:37 +08:00

22 lines
544 B
Go

package store
import "context"
type UserSession struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
LastSeenAt string `json:"last_seen_at"`
}
func (s *Store) UpsertSession(ctx context.Context, id string) error {
_, err := s.db.ExecContext(ctx,
`INSERT INTO user_sessions (id, last_seen_at) VALUES (?, datetime('now'))
ON CONFLICT(id) DO UPDATE SET last_seen_at = datetime('now')`, id,
)
return err
}
func (s *Store) TouchSession(ctx context.Context, id string) error {
return s.UpsertSession(ctx, id)
}