feat: 任务模型物理合并,发布+回收并为单任务双阶段
- tasks 新增 recovery_enabled/recovery_due_at/recovery_instructions/recovery_example_images,回收挂自己名下(先发布后交截图),不再置 complete - 存量 screenshot_collect 迁移并入父任务后删除(mysql/0020 含 DELETE,生产执行前务必备份) - 新 action task_enable_recovery:ghost 面板一键开通回收,截止默认=发布截止 - 企微催办双阶段(待发布/截图待提交);超期自动释放仅发布阶段 - admin 删 groupTaskMasters 聚合改单卡双面板;portal 详情页回收截图区块+批次回收进度 - 测试 309 全绿 + Playwright E2E 20/20
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
} from "../../../lib/feishu-client";
|
||||
import {
|
||||
createDistributionTask,
|
||||
createScreenshotTask,
|
||||
enableTaskRecovery,
|
||||
updateTask,
|
||||
} from "../../../lib/task-service";
|
||||
import {
|
||||
@@ -204,23 +204,34 @@ export async function POST(request: Request) {
|
||||
contentFormat,
|
||||
projectId: String(body.projectId ?? "").trim(),
|
||||
ownerUserid: String(body.ownerUserid ?? "").trim(),
|
||||
recoveryEnabled: body.recoveryEnabled !== false,
|
||||
recoveryDueAt: String(body.recoveryDueAt ?? "").trim(),
|
||||
recoveryInstructions: String(body.recoveryInstructions ?? "").trim(),
|
||||
recoveryExampleImageKey: String(body.recoveryExampleImageKey ?? "").trim(),
|
||||
},
|
||||
env as unknown as FeishuBindings,
|
||||
);
|
||||
ownerWarning = await assignOwnerQuietly(creation.taskId, body.ownerUserid);
|
||||
} else if (body.action === "create_screenshot_task") {
|
||||
const forbidden = await projectOwnerGate(body.projectId);
|
||||
} else if (body.action === "task_enable_recovery") {
|
||||
const taskId = String(body.taskId ?? "").trim();
|
||||
if (!taskId) {
|
||||
return Response.json({ error: "缺少 taskId" }, { status: 400 });
|
||||
}
|
||||
const taskRow = await db
|
||||
.prepare("SELECT project_id FROM tasks WHERE id = ?")
|
||||
.bind(taskId)
|
||||
.first<{ project_id: string }>();
|
||||
if (!taskRow) {
|
||||
return Response.json({ error: "任务不存在" }, { status: 404 });
|
||||
}
|
||||
const forbidden = await projectOwnerGate(taskRow.project_id);
|
||||
if (forbidden) return forbidden;
|
||||
const creation = await createScreenshotTask({
|
||||
name: String(body.name ?? "").trim(),
|
||||
relatedTaskId: String(body.relatedTaskId ?? "").trim(),
|
||||
dueAt: String(body.dueAt ?? "").trim(),
|
||||
instructions: String(body.instructions ?? "").trim(),
|
||||
exampleImageKey: String(body.exampleImageKey ?? "").trim(),
|
||||
projectId: String(body.projectId ?? "").trim(),
|
||||
ownerUserid: String(body.ownerUserid ?? "").trim(),
|
||||
await enableTaskRecovery({
|
||||
taskId,
|
||||
recoveryDueAt: String(body.recoveryDueAt ?? "").trim(),
|
||||
recoveryInstructions: String(body.recoveryInstructions ?? "").trim(),
|
||||
recoveryExampleImageKey: String(body.recoveryExampleImageKey ?? "").trim(),
|
||||
});
|
||||
ownerWarning = await assignOwnerQuietly(creation.taskId, body.ownerUserid);
|
||||
} else if (body.action === "claim") {
|
||||
const forbidden = managerGate();
|
||||
if (forbidden) return forbidden;
|
||||
@@ -939,7 +950,6 @@ export async function POST(request: Request) {
|
||||
mainGroupMemberIds: body.mainGroupMemberIds,
|
||||
ownerUserid: nextOwnerUserid,
|
||||
note: body.note,
|
||||
parentProjectId: body.parentProjectId,
|
||||
},
|
||||
resolveWecomConfig(env as unknown as WecomBindings),
|
||||
);
|
||||
@@ -1011,10 +1021,13 @@ export async function POST(request: Request) {
|
||||
projectId: String(body.projectId ?? ""),
|
||||
platform,
|
||||
contentFormat,
|
||||
quantity: numberValue(body.quantity),
|
||||
keyword: String(body.keyword ?? ""),
|
||||
instructions: String(body.instructions ?? ""),
|
||||
exampleImageKey: String(body.exampleImageKey ?? ""),
|
||||
recoveryEnabled:
|
||||
body.recoveryEnabled === undefined
|
||||
? undefined
|
||||
: Boolean(body.recoveryEnabled),
|
||||
recoveryDueAt: String(body.recoveryDueAt ?? ""),
|
||||
recoveryInstructions: String(body.recoveryInstructions ?? ""),
|
||||
recoveryExampleImageKey: String(body.recoveryExampleImageKey ?? ""),
|
||||
});
|
||||
ownerWarning = await assignOwnerQuietly(update.taskId, body.ownerUserid);
|
||||
} else if (body.action === "partner_save") {
|
||||
|
||||
@@ -75,9 +75,11 @@ async function handleGet(request: Request) {
|
||||
c.video_assets,
|
||||
d.result_screenshot_key,
|
||||
d.publish_screenshot_key,
|
||||
d.screenshot_key
|
||||
d.screenshot_key,
|
||||
t.recovery_example_images
|
||||
FROM distributions d
|
||||
JOIN contents c ON c.id = d.content_id
|
||||
JOIN tasks t ON t.id = d.task_id
|
||||
JOIN delegation_bundles b ON b.id = d.delegation_bundle_id
|
||||
WHERE d.id = ?
|
||||
AND b.share_token = ?
|
||||
@@ -90,6 +92,7 @@ async function handleGet(request: Request) {
|
||||
result_screenshot_key: string | null;
|
||||
publish_screenshot_key: string | null;
|
||||
screenshot_key: string | null;
|
||||
recovery_example_images: string;
|
||||
}>()
|
||||
: await getRawDb()
|
||||
.prepare(
|
||||
@@ -97,7 +100,8 @@ async function handleGet(request: Request) {
|
||||
c.video_assets,
|
||||
d.result_screenshot_key,
|
||||
d.publish_screenshot_key,
|
||||
d.screenshot_key
|
||||
d.screenshot_key,
|
||||
t.recovery_example_images
|
||||
FROM distributions d
|
||||
JOIN contents c ON c.id = d.content_id
|
||||
JOIN claims cl ON cl.id = d.claim_id
|
||||
@@ -114,6 +118,7 @@ async function handleGet(request: Request) {
|
||||
result_screenshot_key: string | null;
|
||||
publish_screenshot_key: string | null;
|
||||
screenshot_key: string | null;
|
||||
recovery_example_images: string;
|
||||
}>();
|
||||
const asset =
|
||||
imageKind === "result"
|
||||
@@ -125,6 +130,10 @@ async function handleGet(request: Request) {
|
||||
],
|
||||
}
|
||||
: undefined
|
||||
: imageKind === "task-example"
|
||||
? row
|
||||
? findAsset(row.recovery_example_images, imageIndex, ["task-assets/"])
|
||||
: undefined
|
||||
: imageKind === "publish"
|
||||
? row?.publish_screenshot_key?.startsWith("publish-evidence/")
|
||||
? { index: 1, key: row.publish_screenshot_key }
|
||||
|
||||
@@ -93,7 +93,7 @@ async function handlePost(request: Request) {
|
||||
const assignment = upload.delegationToken
|
||||
? await getRawDb()
|
||||
.prepare(
|
||||
`SELECT d.id, d.publish_url, d.result_screenshot_key, t.task_type
|
||||
`SELECT d.id, d.publish_url, d.result_screenshot_key, t.recovery_enabled
|
||||
FROM distributions d
|
||||
JOIN delegation_bundles b ON b.id = d.delegation_bundle_id
|
||||
JOIN tasks t ON t.id = d.task_id
|
||||
@@ -102,10 +102,10 @@ async function handlePost(request: Request) {
|
||||
AND b.status = 'active'`,
|
||||
)
|
||||
.bind(upload.distributionId, upload.delegationToken)
|
||||
.first<{ id: string; publish_url: string | null; result_screenshot_key: string | null; task_type: string }>()
|
||||
.first<{ id: string; publish_url: string | null; result_screenshot_key: string | null; recovery_enabled: number }>()
|
||||
: await getRawDb()
|
||||
.prepare(
|
||||
`SELECT d.id, d.publish_url, d.result_screenshot_key, t.task_type
|
||||
`SELECT d.id, d.publish_url, d.result_screenshot_key, t.recovery_enabled
|
||||
FROM distributions d
|
||||
JOIN claims c ON c.id = d.claim_id
|
||||
JOIN tasks t ON t.id = d.task_id
|
||||
@@ -115,7 +115,7 @@ async function handlePost(request: Request) {
|
||||
AND c.task_id = t.id`,
|
||||
)
|
||||
.bind(upload.distributionId, upload.claimToken, upload.taskToken)
|
||||
.first<{ id: string; publish_url: string | null; result_screenshot_key: string | null; task_type: string }>();
|
||||
.first<{ id: string; publish_url: string | null; result_screenshot_key: string | null; recovery_enabled: number }>();
|
||||
if (!assignment) {
|
||||
return Response.json({ error: "笔记与领取凭证不匹配" }, { status: 403 });
|
||||
}
|
||||
@@ -125,11 +125,8 @@ async function handlePost(request: Request) {
|
||||
{ status: 409 },
|
||||
);
|
||||
}
|
||||
if (isTaskResult && assignment.task_type !== "screenshot_collect") {
|
||||
return Response.json({ error: "当前任务不支持截图结果回填" }, { status: 400 });
|
||||
}
|
||||
if (!isTaskResult && assignment.task_type === "screenshot_collect") {
|
||||
return Response.json({ error: "截图回收任务请上传任务结果截图" }, { status: 400 });
|
||||
if (isTaskResult && Number(assignment.recovery_enabled) !== 1) {
|
||||
return Response.json({ error: "该任务未开通截图回收" }, { status: 400 });
|
||||
}
|
||||
const existingResultKeys = isTaskResult
|
||||
? parseResultScreenshotKeys(assignment.result_screenshot_key)
|
||||
|
||||
@@ -102,6 +102,15 @@ function idList(value: unknown) {
|
||||
];
|
||||
}
|
||||
|
||||
function recoveryPayload(task: PartnerTask) {
|
||||
return {
|
||||
recoveryEnabled: Number(task?.recovery_enabled) === 1,
|
||||
recoveryDueAt: String(task?.recovery_due_at ?? ""),
|
||||
recoveryInstructions: String(task?.recovery_instructions ?? ""),
|
||||
recoveryExampleImages: publicImageAssets(task?.recovery_example_images),
|
||||
};
|
||||
}
|
||||
|
||||
function publicImageAssets(value: unknown): ImageAsset[] {
|
||||
try {
|
||||
const assets = JSON.parse(String(value ?? "[]")) as Array<
|
||||
@@ -137,13 +146,18 @@ type PartnerTask = {
|
||||
task_type: string;
|
||||
platform: string;
|
||||
content_format: string;
|
||||
recovery_enabled: number;
|
||||
recovery_due_at: string;
|
||||
recovery_instructions: string | null;
|
||||
recovery_example_images: string;
|
||||
};
|
||||
|
||||
async function findTask(taskToken: string) {
|
||||
return getRawDb()
|
||||
.prepare(
|
||||
`SELECT id, name, brand, quantity, claimed_quantity, due_at, status,
|
||||
task_type, platform, content_format
|
||||
task_type, platform, content_format,
|
||||
recovery_enabled, recovery_due_at, recovery_instructions, recovery_example_images
|
||||
FROM tasks WHERE share_token = ?`,
|
||||
)
|
||||
.bind(taskToken)
|
||||
@@ -164,6 +178,10 @@ async function findDelegationAccess(delegationToken: string) {
|
||||
t.task_type,
|
||||
t.platform,
|
||||
t.content_format,
|
||||
t.recovery_enabled,
|
||||
t.recovery_due_at,
|
||||
t.recovery_instructions,
|
||||
t.recovery_example_images,
|
||||
b.id AS bundle_id,
|
||||
b.label AS bundle_label,
|
||||
b.quantity AS bundle_quantity,
|
||||
@@ -398,7 +416,7 @@ async function handleGet(request: Request) {
|
||||
.all();
|
||||
delegation = {
|
||||
id: delegationAccess.bundle_id,
|
||||
label: task.task_type === "screenshot_collect" ? "转派截图任务包" : "转派发布包",
|
||||
label: "转派发布包",
|
||||
quantity: delegationAccess.bundle_quantity,
|
||||
createdAt: delegationAccess.bundle_created_at,
|
||||
assignments: assignments.results.map((assignment) => ({
|
||||
@@ -421,6 +439,8 @@ async function handleGet(request: Request) {
|
||||
type: task.task_type,
|
||||
platform: task.platform,
|
||||
contentFormat: task.content_format,
|
||||
recoveryEnabled: recoveryPayload(task).recoveryEnabled,
|
||||
recoveryDueAt: recoveryPayload(task).recoveryDueAt,
|
||||
}
|
||||
: {
|
||||
name: task.name,
|
||||
@@ -433,6 +453,7 @@ async function handleGet(request: Request) {
|
||||
platform: task.platform,
|
||||
contentFormat: task.content_format,
|
||||
availableQuantity: available?.count ?? 0,
|
||||
...recoveryPayload(task),
|
||||
},
|
||||
claim,
|
||||
delegation,
|
||||
@@ -534,8 +555,7 @@ async function handlePost(request: Request) {
|
||||
c.created_at,
|
||||
COUNT(d.id) AS note_count,
|
||||
SUM(CASE
|
||||
WHEN ? = 'screenshot_collect' AND d.result_submitted_at IS NOT NULL THEN 1
|
||||
WHEN ? != 'screenshot_collect' AND d.publish_url IS NOT NULL AND d.publish_url != '' THEN 1
|
||||
WHEN d.publish_url IS NOT NULL AND d.publish_url != '' THEN 1
|
||||
ELSE 0 END) AS completed_count,
|
||||
MIN(co.title) AS first_title
|
||||
FROM claims c
|
||||
@@ -548,7 +568,7 @@ async function handlePost(request: Request) {
|
||||
ORDER BY c.created_at DESC, c.id DESC
|
||||
LIMIT 20`,
|
||||
)
|
||||
.bind(task.task_type, task.task_type, task.id, ...partnerCandidates)
|
||||
.bind(task.id, ...partnerCandidates)
|
||||
.all<{
|
||||
claim_token: string;
|
||||
quantity: number;
|
||||
@@ -569,7 +589,7 @@ async function handlePost(request: Request) {
|
||||
quantity: claim.note_count || claim.quantity,
|
||||
completedCount: claim.completed_count || 0,
|
||||
createdAt: claim.created_at,
|
||||
firstTitle: claim.first_title || (task.task_type === "screenshot_collect" ? "领取的截图任务" : "领取的笔记"),
|
||||
firstTitle: claim.first_title || "领取的笔记",
|
||||
})),
|
||||
});
|
||||
}
|
||||
@@ -788,7 +808,7 @@ async function handlePost(request: Request) {
|
||||
}
|
||||
if (distributionIds.length === 0) {
|
||||
return Response.json(
|
||||
{ error: task.task_type === "screenshot_collect" ? "请至少选择一份待提交任务" : "请至少选择一篇待发布笔记" },
|
||||
{ error: "请至少选择一篇待发布笔记" },
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
@@ -823,13 +843,9 @@ async function handlePost(request: Request) {
|
||||
{ status: 403 },
|
||||
);
|
||||
}
|
||||
if (selected.results.some((item) =>
|
||||
task.task_type === "screenshot_collect"
|
||||
? item.result_submitted_at
|
||||
: item.publish_url,
|
||||
)) {
|
||||
if (selected.results.some((item) => item.publish_url)) {
|
||||
return Response.json(
|
||||
{ error: task.task_type === "screenshot_collect" ? "已提交的截图任务不能再次转派" : "已发布的笔记不能再次转派" },
|
||||
{ error: "已发布的笔记不能再次转派" },
|
||||
{ status: 409 },
|
||||
);
|
||||
}
|
||||
@@ -942,7 +958,7 @@ async function handlePost(request: Request) {
|
||||
.first<{ count: number }>();
|
||||
if ((completed?.count ?? 0) > 0) {
|
||||
return Response.json(
|
||||
{ error: task.task_type === "screenshot_collect" ? "该分享包已有截图提交,不能撤销" : "该分享包已有笔记发布,需保留链接继续完成第7天数据回收" },
|
||||
{ error: "该分享包已有笔记发布,需保留链接继续完成第7天数据回收" },
|
||||
{ status: 409 },
|
||||
);
|
||||
}
|
||||
@@ -968,9 +984,6 @@ async function handlePost(request: Request) {
|
||||
}
|
||||
|
||||
if (body.action === "submit") {
|
||||
if (task.task_type === "screenshot_collect") {
|
||||
return Response.json({ error: "截图回收任务无需填写发布链接" }, { status: 400 });
|
||||
}
|
||||
const claimToken = textValue(body.claimToken, 80);
|
||||
const distributionId = textValue(body.distributionId, 80);
|
||||
const publishInput = textValue(body.publishUrl, 5000);
|
||||
@@ -1193,9 +1206,6 @@ async function handlePost(request: Request) {
|
||||
}
|
||||
|
||||
if (body.action === "submit_creator_metrics") {
|
||||
if (task.task_type === "screenshot_collect") {
|
||||
return Response.json({ error: "截图回收任务不需要创作者数据" }, { status: 400 });
|
||||
}
|
||||
const claimToken = textValue(body.claimToken, 80);
|
||||
const distributionId = textValue(body.distributionId, 80);
|
||||
const exposure = creatorMetricValue(body.exposure);
|
||||
@@ -1244,8 +1254,8 @@ async function handlePost(request: Request) {
|
||||
}
|
||||
|
||||
if (body.action === "submit_screenshot_result") {
|
||||
if (task.task_type !== "screenshot_collect") {
|
||||
return Response.json({ error: "当前任务不支持这种回填方式" }, { status: 400 });
|
||||
if (Number(task.recovery_enabled) !== 1) {
|
||||
return Response.json({ error: "该任务未开通截图回收" }, { status: 400 });
|
||||
}
|
||||
const claimToken = textValue(body.claimToken, 80);
|
||||
const distributionId = textValue(body.distributionId, 80);
|
||||
@@ -1256,17 +1266,22 @@ async function handlePost(request: Request) {
|
||||
delegationToken,
|
||||
);
|
||||
if (!assignment) {
|
||||
return Response.json({ error: "任务与领取凭证不匹配" }, { status: 403 });
|
||||
return Response.json({ error: "笔记与领取凭证不匹配" }, { status: 403 });
|
||||
}
|
||||
if (!assignment.publish_url) {
|
||||
return Response.json(
|
||||
{ error: "请先回填这篇笔记的发布链接,再提交回收截图" },
|
||||
{ status: 409 },
|
||||
);
|
||||
}
|
||||
if (!assignment.result_screenshot_key) {
|
||||
return Response.json({ error: "请先上传任务截图" }, { status: 400 });
|
||||
return Response.json({ error: "请先上传回收截图" }, { status: 400 });
|
||||
}
|
||||
const statements: DatabaseStatement[] = [
|
||||
db
|
||||
.prepare(
|
||||
`UPDATE distributions SET
|
||||
result_submitted_at = CURRENT_TIMESTAMP,
|
||||
status = 'complete',
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = ?`,
|
||||
)
|
||||
|
||||
@@ -40,6 +40,7 @@ type ExportRow = {
|
||||
publish_url: string | null;
|
||||
publish_time: string | null;
|
||||
publish_screenshot_key: string | null;
|
||||
result_submitted_at: string | null;
|
||||
screenshot_key: string | null;
|
||||
exposure: number | null;
|
||||
views: number | null;
|
||||
@@ -252,9 +253,17 @@ export async function GET(request: Request) {
|
||||
}
|
||||
}
|
||||
const task = await db
|
||||
.prepare("SELECT id, name, brand, platform FROM tasks WHERE id = ?")
|
||||
.prepare(
|
||||
"SELECT id, name, brand, platform, recovery_enabled FROM tasks WHERE id = ?",
|
||||
)
|
||||
.bind(taskId)
|
||||
.first<{ id: string; name: string; brand: string; platform: string }>();
|
||||
.first<{
|
||||
id: string;
|
||||
name: string;
|
||||
brand: string;
|
||||
platform: string;
|
||||
recovery_enabled: number;
|
||||
}>();
|
||||
if (!task) {
|
||||
return Response.json({ error: "没有找到这个任务" }, { status: 404 });
|
||||
}
|
||||
@@ -270,6 +279,7 @@ export async function GET(request: Request) {
|
||||
d.publish_url,
|
||||
d.publish_time,
|
||||
d.publish_screenshot_key,
|
||||
d.result_submitted_at,
|
||||
d.screenshot_key,
|
||||
d.exposure,
|
||||
d.views,
|
||||
@@ -304,34 +314,7 @@ export async function GET(request: Request) {
|
||||
.bind(taskId)
|
||||
.all<ExportRow>();
|
||||
const rows = result.results;
|
||||
const companionTaskRow = await db
|
||||
.prepare(
|
||||
"SELECT id FROM tasks WHERE related_task_id = ? AND task_type = 'screenshot_collect' LIMIT 1",
|
||||
)
|
||||
.bind(taskId)
|
||||
.first<{ id: string }>();
|
||||
let companionSubmittedByContent: Map<string, boolean> | null = null;
|
||||
if (companionTaskRow) {
|
||||
const companionRows = await db
|
||||
.prepare(
|
||||
`SELECT c.related_content_id, d.result_submitted_at
|
||||
FROM distributions d
|
||||
JOIN contents c ON c.id = d.content_id
|
||||
WHERE d.task_id = ? AND c.related_content_id != ''`,
|
||||
)
|
||||
.bind(companionTaskRow.id)
|
||||
.all<{
|
||||
related_content_id: string;
|
||||
result_submitted_at: string | null;
|
||||
}>();
|
||||
companionSubmittedByContent = new Map<string, boolean>();
|
||||
for (const row of companionRows.results) {
|
||||
companionSubmittedByContent.set(
|
||||
row.related_content_id,
|
||||
Boolean(row.result_submitted_at),
|
||||
);
|
||||
}
|
||||
}
|
||||
const recoveryEnabled = Number(task.recovery_enabled) === 1;
|
||||
const assetsByContent = new Map(
|
||||
rows.map((row) => [row.content_id, parseAssets(row.image_assets)]),
|
||||
);
|
||||
@@ -384,7 +367,7 @@ export async function GET(request: Request) {
|
||||
"采集状态",
|
||||
"合作方",
|
||||
"领取人微信号/手机号",
|
||||
...(companionSubmittedByContent ? ["收录截图"] : []),
|
||||
...(recoveryEnabled ? ["收录截图"] : []),
|
||||
];
|
||||
const originalImageStart = 3;
|
||||
const accountColumn = originalImageStart + maxContentImages;
|
||||
@@ -427,10 +410,10 @@ export async function GET(request: Request) {
|
||||
row.distribution_id ? collectionLabel(row) : "未领取",
|
||||
row.partner_name || "",
|
||||
row.claimant_name || "",
|
||||
...(companionSubmittedByContent
|
||||
...(recoveryEnabled
|
||||
? [
|
||||
companionSubmittedByContent.has(row.content_id)
|
||||
? companionSubmittedByContent.get(row.content_id)
|
||||
row.distribution_id
|
||||
? row.result_submitted_at
|
||||
? "已提交"
|
||||
: "未提交"
|
||||
: "—",
|
||||
@@ -471,7 +454,7 @@ export async function GET(request: Request) {
|
||||
24,
|
||||
18,
|
||||
22,
|
||||
...(companionSubmittedByContent ? [12] : []),
|
||||
...(recoveryEnabled ? [12] : []),
|
||||
];
|
||||
const workbook = buildRecoveryWorkbook({
|
||||
sheetName: `${task.name}-数据回收`,
|
||||
|
||||
@@ -29,11 +29,11 @@ export async function GET(request: Request) {
|
||||
return ownerForbidden();
|
||||
}
|
||||
const task = await getRawDb()
|
||||
.prepare("SELECT name, task_type FROM tasks WHERE id = ?")
|
||||
.prepare("SELECT name FROM tasks WHERE id = ?")
|
||||
.bind(taskId)
|
||||
.first<{ name: string; task_type: string }>();
|
||||
if (!task || task.task_type !== "screenshot_collect") {
|
||||
return Response.json({ error: "没有找到截图回收任务" }, { status: 404 });
|
||||
.first<{ name: string }>();
|
||||
if (!task) {
|
||||
return Response.json({ error: "没有找到任务" }, { status: 404 });
|
||||
}
|
||||
const rows = await getRawDb()
|
||||
.prepare(
|
||||
@@ -60,7 +60,7 @@ export async function GET(request: Request) {
|
||||
}>();
|
||||
const files: Record<string, Uint8Array> = {};
|
||||
const manifest = [
|
||||
["序号", "搜索关键词", "领取人", "领取时间", "提交时间", "文件名"],
|
||||
["序号", "笔记标题", "领取人", "领取时间", "提交时间", "文件名"],
|
||||
];
|
||||
let exported = 0;
|
||||
for (const [rowIndex, row] of rows.results.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user