mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: channel gateway implementation and multi-bot refactor
- 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>
This commit is contained in:
@@ -11,6 +11,32 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const getContainerByBotID = `-- name: GetContainerByBotID :one
|
||||
SELECT id, bot_id, container_id, container_name, image, status, namespace, auto_start, host_path, container_path, created_at, updated_at, last_started_at, last_stopped_at FROM containers WHERE bot_id = $1 ORDER BY updated_at DESC LIMIT 1
|
||||
`
|
||||
|
||||
func (q *Queries) GetContainerByBotID(ctx context.Context, botID pgtype.UUID) (Container, error) {
|
||||
row := q.db.QueryRow(ctx, getContainerByBotID, botID)
|
||||
var i Container
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.BotID,
|
||||
&i.ContainerID,
|
||||
&i.ContainerName,
|
||||
&i.Image,
|
||||
&i.Status,
|
||||
&i.Namespace,
|
||||
&i.AutoStart,
|
||||
&i.HostPath,
|
||||
&i.ContainerPath,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.LastStartedAt,
|
||||
&i.LastStoppedAt,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getContainerByContainerID = `-- name: GetContainerByContainerID :one
|
||||
SELECT id, bot_id, container_id, container_name, image, status, namespace, auto_start, host_path, container_path, created_at, updated_at, last_started_at, last_stopped_at FROM containers WHERE container_id = $1
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user