5301557ad2
CI / docker (push) Has been cancelled
引入用户端对话/生图与管理端 Provider 配置,统一 invoke 编排、Gateway、请求日志与模型管理;前端按设计规范拆分布局,Go module 更名为 github.com/rose_cat707/Atlas;生图长任务 SSE 推送;管理端登录防爆破;协议与服务类型联动;Replicate 模型同步修复;用户端创作台 UI 重构;管理端创作历史替代请求日志。 Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
544 B
Go
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)
|
|
}
|