feat(desktop): drop parked review flow, add publish management

SaaS 侧人工审核后才创建 publish job,desktop 不再做二次审核:移除
manual/waiting_user/parked/from_parked 状态机与 LeaseFromParked 查询,
desktop client 只执行发布并新增"发布管理"页(待发布队列 / 历史 / 再次
发送)。同时抽离 @geo/publisher-platforms 共享适配器包、新增 Redis-based
desktop_presence 与 publish_record_support,刷新 admin-web 发布弹窗与
媒体库;plan A / spec 文档同步口径。
This commit is contained in:
2026-04-20 09:52:48 +08:00
parent b16e9f0bd1
commit a617d39a4a
93 changed files with 5519 additions and 3594 deletions
@@ -21,6 +21,7 @@ type DesktopAccount struct {
PlatformUID string
AccountFingerprint *string
DisplayName string
AvatarURL *string
Health string
VerifiedAt *time.Time
Tags []string
@@ -41,6 +42,7 @@ type UpsertDesktopAccountParams struct {
PlatformUID string
AccountFingerprint *string
DisplayName string
AvatarURL *string
Health string
VerifiedAt *time.Time
Tags []string
@@ -58,7 +60,7 @@ type PatchDesktopAccountParams struct {
}
type DesktopAccountRepository interface {
ListByClient(ctx context.Context, workspaceID int64, clientID uuid.UUID) ([]DesktopAccount, error)
ListByUser(ctx context.Context, workspaceID, userID int64) ([]DesktopAccount, error)
GetByDesktopID(ctx context.Context, desktopID uuid.UUID, workspaceID int64) (*DesktopAccount, error)
GetByIdentity(ctx context.Context, workspaceID int64, platform, platformUID string) (*DesktopAccount, error)
Upsert(ctx context.Context, params UpsertDesktopAccountParams) (*DesktopAccount, error)
@@ -76,10 +78,10 @@ func NewDesktopAccountRepository(db generated.DBTX) DesktopAccountRepository {
return &desktopAccountRepository{q: newQuerier(db)}
}
func (r *desktopAccountRepository) ListByClient(ctx context.Context, workspaceID int64, clientID uuid.UUID) ([]DesktopAccount, error) {
rows, err := r.q.ListDesktopAccountsByClient(ctx, generated.ListDesktopAccountsByClientParams{
func (r *desktopAccountRepository) ListByUser(ctx context.Context, workspaceID, userID int64) ([]DesktopAccount, error) {
rows, err := r.q.ListDesktopAccountsByUser(ctx, generated.ListDesktopAccountsByUserParams{
WorkspaceID: workspaceID,
ClientID: pgUUID(clientID),
UserID: userID,
})
if err != nil {
return nil, err
@@ -142,6 +144,7 @@ func (r *desktopAccountRepository) Upsert(ctx context.Context, params UpsertDesk
PlatformID: params.Platform,
PlatformUid: params.PlatformUID,
DisplayName: params.DisplayName,
AvatarUrl: pgText(params.AvatarURL),
LegacyStatus: legacyStatusFromHealth(params.Health),
MetadataJson: metadataJSON,
VerifiedAt: pgTimestamp(params.VerifiedAt),
@@ -216,7 +219,7 @@ func (r *desktopAccountRepository) ClearDeleteRequested(ctx context.Context, des
return desktopAccountFromClearDeleteRow(row)
}
func desktopAccountFromListRow(row generated.ListDesktopAccountsByClientRow) (*DesktopAccount, error) {
func desktopAccountFromListRow(row generated.ListDesktopAccountsByUserRow) (*DesktopAccount, error) {
return buildDesktopAccount(
row.DesktopID,
row.TenantID,
@@ -227,6 +230,7 @@ func desktopAccountFromListRow(row generated.ListDesktopAccountsByClientRow) (*D
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -249,6 +253,7 @@ func desktopAccountFromGetRow(row generated.GetDesktopAccountByDesktopIDRow) (*D
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -271,6 +276,7 @@ func desktopAccountFromIdentityRow(row generated.GetDesktopAccountByIdentityRow)
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -293,6 +299,7 @@ func desktopAccountFromUpsertRow(row generated.UpsertDesktopAccountRow) (*Deskto
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -315,6 +322,7 @@ func desktopAccountFromPatchRow(row generated.PatchDesktopAccountRow) (*DesktopA
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -337,6 +345,7 @@ func desktopAccountFromTombstoneRow(row generated.TombstoneDesktopAccountRow) (*
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -359,6 +368,7 @@ func desktopAccountFromMarkDeleteRow(row generated.MarkDesktopAccountDeleteReque
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -381,6 +391,7 @@ func desktopAccountFromClearDeleteRow(row generated.ClearDesktopAccountDeleteReq
row.PlatformUid,
row.AccountFingerprint,
row.DisplayName,
row.AvatarUrl,
row.Health,
row.VerifiedAt,
row.Tags,
@@ -402,6 +413,7 @@ func buildDesktopAccount(
platformUID string,
accountFingerprint pgtype.Text,
displayName string,
avatarURL pgtype.Text,
health string,
verifiedAt pgtype.Timestamptz,
tags []byte,
@@ -426,6 +438,7 @@ func buildDesktopAccount(
PlatformUID: platformUID,
AccountFingerprint: nullableText(accountFingerprint),
DisplayName: displayName,
AvatarURL: nullableText(avatarURL),
Health: health,
VerifiedAt: optionalTime(verifiedAt),
Tags: tagList,