feat: 数据回流通知(提交/采集结果推运营群,默认关闭)
This commit is contained in:
@@ -28,6 +28,14 @@ import {
|
||||
verifyWecomIdentityTicket,
|
||||
type WecomIdentity,
|
||||
} from "../../../lib/wecom-oauth-service";
|
||||
import {
|
||||
isWecomFeedbackEnabled,
|
||||
notifyPartnerSubmitted,
|
||||
} from "../../../lib/wecom-feedback-service";
|
||||
import {
|
||||
resolveWecomConfig,
|
||||
type WecomBindings,
|
||||
} from "../../../lib/wecom-client";
|
||||
import {
|
||||
partnerOptions,
|
||||
withPartnerCors,
|
||||
@@ -1063,6 +1071,14 @@ async function handlePost(request: Request) {
|
||||
),
|
||||
).catch(() => undefined);
|
||||
runInBackground(enrichment, "distribution account enrichment");
|
||||
if (isWecomFeedbackEnabled()) {
|
||||
const feedback = notifyPartnerSubmitted(
|
||||
db,
|
||||
{ distributionId: assignment.id, kind: "publish" },
|
||||
resolveWecomConfig(env as unknown as WecomBindings),
|
||||
).catch(() => undefined);
|
||||
runInBackground(feedback, "wecom publish feedback");
|
||||
}
|
||||
return Response.json({ ok: true });
|
||||
}
|
||||
|
||||
@@ -1156,6 +1172,14 @@ async function handlePost(request: Request) {
|
||||
);
|
||||
}
|
||||
await db.batch(statements);
|
||||
if (isWecomFeedbackEnabled()) {
|
||||
const feedback = notifyPartnerSubmitted(
|
||||
db,
|
||||
{ distributionId: assignment.id, kind: "screenshot" },
|
||||
resolveWecomConfig(env as unknown as WecomBindings),
|
||||
).catch(() => undefined);
|
||||
runInBackground(feedback, "wecom screenshot feedback");
|
||||
}
|
||||
return Response.json({ submitted: true });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user