mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
5a35ef34ac
- Refactor channel manager with support for Sender/Receiver interfaces and hot-swappable adapters. - Implement identity routing and pre-authentication logic for inbound messages. - Update database schema to support bot pre-auth keys and extended channel session metadata. - Add Telegram and Feishu channel configuration and adapter enhancements. - Update Swagger documentation and internal handlers for channel management. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
548 B
SQL
17 lines
548 B
SQL
-- name: CreateBotPreauthKey :one
|
|
INSERT INTO bot_preauth_keys (bot_id, token, issued_by_user_id, expires_at)
|
|
VALUES ($1, $2, $3, $4)
|
|
RETURNING id, bot_id, token, issued_by_user_id, expires_at, used_at, created_at;
|
|
|
|
-- name: GetBotPreauthKey :one
|
|
SELECT id, bot_id, token, issued_by_user_id, expires_at, used_at, created_at
|
|
FROM bot_preauth_keys
|
|
WHERE token = $1
|
|
LIMIT 1;
|
|
|
|
-- name: MarkBotPreauthKeyUsed :one
|
|
UPDATE bot_preauth_keys
|
|
SET used_at = now()
|
|
WHERE id = $1
|
|
RETURNING id, bot_id, token, issued_by_user_id, expires_at, used_at, created_at;
|