feat(ops): v4.0.7 HQ 活动图快链与勾选导出

HQ 指定一张活动图为勾选主合伙人合成 PNG/zip;城市合伙人页增加快链与单下/导出。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 15:12:10 +08:00
parent eeee55e215
commit cdc4b82931
21 changed files with 1041 additions and 28 deletions
@@ -452,4 +452,19 @@ export class PartnerAssocService {
const buffer = Buffer.from(await res.arrayBuffer());
return { buffer, fileName: `partner-assoc-${summary.partnerId}.png` };
}
/** 只读已有 OSS 关联码,不调微信补码。无码返回 null。 */
async getExistingQrcodeBuffer(partnerAccountId: bigint): Promise<{ buffer: Buffer; fileName: string } | null> {
const primary = await this.partnerCityService.resolvePrimaryAccount(partnerAccountId);
if (!primary.assocQrcodeResourceId) return null;
const resource = await this.prisma.commonResource.findUnique({
where: { id: primary.assocQrcodeResourceId },
select: { url: true },
});
if (!resource?.url) return null;
const res = await fetch(resource.url);
if (!res.ok) return null;
const buffer = Buffer.from(await res.arrayBuffer());
return { buffer, fileName: `partner-assoc-${primary.id.toString()}.png` };
}
}