feat: KOC资源页新增一键爬取更新全部账号ID
This commit is contained in:
@@ -54,6 +54,10 @@ import {
|
||||
} from "../../../lib/wecom-group-push-service";
|
||||
import { isManagerRequest } from "../../../lib/user-auth";
|
||||
import { extractPublishUrl } from "../../../lib/publish-url";
|
||||
import {
|
||||
getPublicAccountIdRefreshStatus,
|
||||
startPublicAccountIdRefresh,
|
||||
} from "../../../lib/account-id-refresh-service";
|
||||
|
||||
type ActionBody = {
|
||||
action?: string;
|
||||
@@ -683,6 +687,14 @@ export async function POST(request: Request) {
|
||||
const taskId = String(body.taskId ?? "").trim();
|
||||
const pushes = await listGroupPushes(db, taskId || undefined);
|
||||
return Response.json({ pushes });
|
||||
} else if (body.action === "refresh_public_account_ids") {
|
||||
const status = startPublicAccountIdRefresh(
|
||||
db,
|
||||
resolveCollectionMcpConfig(env as unknown as CollectionMcpBindings),
|
||||
);
|
||||
return Response.json({ refresh: status });
|
||||
} else if (body.action === "public_account_id_refresh_status") {
|
||||
return Response.json({ refresh: getPublicAccountIdRefreshStatus() });
|
||||
} else if (body.action === "wecom_group_chats") {
|
||||
const groups = await listGroupChatRows(db);
|
||||
return Response.json({ groups });
|
||||
|
||||
Reference in New Issue
Block a user