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:
@@ -15,6 +15,8 @@ import type {
|
||||
CompetitorRequest,
|
||||
CreatePluginSessionRequest,
|
||||
CreatePluginSessionResponse,
|
||||
CreatePublishJobRequest,
|
||||
CreatePublishJobResponse,
|
||||
CreatePublishBatchRequest,
|
||||
CreatePublishBatchResponse,
|
||||
GenerateFromRuleRequest,
|
||||
@@ -104,6 +106,7 @@ import type {
|
||||
CreateKolPromptRequest,
|
||||
UpdateKolPackageRequest,
|
||||
UpdateKolPromptRequest,
|
||||
DesktopAccountInfo,
|
||||
UserInfo,
|
||||
WorkspaceOverview,
|
||||
} from "@geo/shared-types";
|
||||
@@ -869,7 +872,7 @@ export const brandsApi = {
|
||||
|
||||
export const mediaApi = {
|
||||
platforms() {
|
||||
return removedMediaApi<MediaPlatform[]>("platforms");
|
||||
return apiClient.get<MediaPlatform[]>("/api/tenant/media/platforms");
|
||||
},
|
||||
accounts() {
|
||||
return removedMediaApi<PlatformAccount[]>("accounts");
|
||||
@@ -888,6 +891,22 @@ export const mediaApi = {
|
||||
},
|
||||
};
|
||||
|
||||
export const tenantAccountsApi = {
|
||||
list() {
|
||||
return apiClient.get<DesktopAccountInfo[]>("/api/tenant/accounts");
|
||||
},
|
||||
requestDelete(id: string, options?: { undo?: boolean }) {
|
||||
const query = options?.undo ? "?undo=true" : "";
|
||||
return apiClient.post<DesktopAccountInfo>(`/api/tenant/accounts/${encodeURIComponent(id)}/request-delete${query}`);
|
||||
},
|
||||
};
|
||||
|
||||
export const publishJobsApi = {
|
||||
create(payload: CreatePublishJobRequest) {
|
||||
return apiClient.post<CreatePublishJobResponse, CreatePublishJobRequest>("/api/tenant/publish-jobs", payload);
|
||||
},
|
||||
};
|
||||
|
||||
function removedMediaApi<T>(action: string): Promise<T> {
|
||||
return Promise.reject(new ApiClientError({
|
||||
message: "desktop_media_api_removed",
|
||||
|
||||
@@ -50,6 +50,10 @@ const errorMessageMap: Record<string, string> = {
|
||||
brand_not_found: "品牌不存在或已删除",
|
||||
keyword_not_found: "关键词不存在或已删除",
|
||||
publish_cover_required: "已选择百家号,请先上传封面图",
|
||||
desktop_account_client_missing: "所选账号还没有绑定桌面客户端,暂时无法发布",
|
||||
desktop_account_not_found: "所选桌面账号不存在,请刷新后重试",
|
||||
desktop_publish_job_store_unavailable: "发布队列暂时不可用,请稍后重试",
|
||||
desktop_media_api_removed: "旧版媒体接口已下线,请刷新页面后重试",
|
||||
publisher_plugin_timeout: "浏览器插件响应超时,请刷新当前页面后重试",
|
||||
publisher_plugin_empty_response: "浏览器插件未返回数据,请刷新当前页面后重试",
|
||||
publisher_plugin_invalid_response: "浏览器插件返回了无效数据,请刷新当前页面后重试",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MediaPlatform, PlatformAccount } from "@geo/shared-types";
|
||||
import type { DesktopAccountInfo, MediaPlatform, PlatformAccount } from "@geo/shared-types";
|
||||
|
||||
export interface PublishPlatformOption {
|
||||
id: string;
|
||||
@@ -53,10 +53,14 @@ export function normalizePublishPlatformIds(platformIds?: Array<string | null |
|
||||
|
||||
export function buildPublishPlatformOptions(
|
||||
platforms: MediaPlatform[],
|
||||
accounts?: PlatformAccount[] | null,
|
||||
accounts?: Array<PlatformAccount | DesktopAccountInfo> | null,
|
||||
): PublishPlatformOption[] {
|
||||
const boundPlatformIds = new Set(
|
||||
(accounts ?? []).map((account) => normalizePublishPlatformId(account.platform_id)).filter(Boolean),
|
||||
(accounts ?? [])
|
||||
.map((account) =>
|
||||
normalizePublishPlatformId("platform_id" in account ? account.platform_id : account.platform),
|
||||
)
|
||||
.filter(Boolean),
|
||||
);
|
||||
|
||||
return platforms.map((platform) => {
|
||||
|
||||
Reference in New Issue
Block a user