refactor(core): migrate channel identity and binding across app

Align channel identity and bind flow across backend and app-facing layers, including generated swagger artifacts and package lock updates while excluding docs content changes.
This commit is contained in:
BBQ
2026-02-11 14:47:03 +08:00
parent 155c70685f
commit 06e8619a37
147 changed files with 11931 additions and 9234 deletions
+22
View File
@@ -0,0 +1,22 @@
-- name: CreateBindCode :one
INSERT INTO channel_identity_bind_codes (token, issued_by_user_id, platform, expires_at)
VALUES ($1, $2, $3, $4)
RETURNING id, token, issued_by_user_id, platform, expires_at, used_at, used_by_channel_identity_id, created_at;
-- name: GetBindCode :one
SELECT id, token, issued_by_user_id, platform, expires_at, used_at, used_by_channel_identity_id, created_at
FROM channel_identity_bind_codes
WHERE token = $1;
-- name: GetBindCodeForUpdate :one
SELECT id, token, issued_by_user_id, platform, expires_at, used_at, used_by_channel_identity_id, created_at
FROM channel_identity_bind_codes
WHERE token = $1
FOR UPDATE;
-- name: MarkBindCodeUsed :one
UPDATE channel_identity_bind_codes
SET used_at = now(), used_by_channel_identity_id = $2
WHERE id = $1
AND used_at IS NULL
RETURNING id, token, issued_by_user_id, platform, expires_at, used_at, used_by_channel_identity_id, created_at;