From 00a48557154f1ed2433c6d1b5e1a74ae9e7d693a Mon Sep 17 00:00:00 2001 From: john Date: Thu, 23 Jul 2026 18:14:10 +0800 Subject: [PATCH] fix: wire admin recharge WeChat notifications --- server/bootstrap.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/bootstrap.mjs b/server/bootstrap.mjs index cb603c2..7f259e3 100644 --- a/server/bootstrap.mjs +++ b/server/bootstrap.mjs @@ -18,6 +18,7 @@ export async function bootstrapAdminServices() { const createLlmProviderService = await loadCreateLlmProviderService(); const { createWechatAdminService } = await importMemind('wechat-admin.mjs'); const { createWechatMpService, loadWechatMpConfig } = await importMemind('wechat-mp.mjs'); + const { createNotificationDispatcher } = await importMemind('notification-dispatcher.mjs'); const { createPlazaPostService, formatPostRow } = await importMemind('plaza-posts.mjs'); const { createPlazaInteractionService } = await importMemind('plaza-interactions.mjs'); const { createPlazaOpsService } = await importMemind('plaza-ops.mjs'); @@ -119,6 +120,14 @@ export async function bootstrapAdminServices() { throw new Error('admin api does not proxy WeChat chat sessions'); }, }); + const notificationDispatcher = createNotificationDispatcher({ + sendWechatTextToUser: wechatMpService?.enabled + ? (userId, text) => wechatMpService.sendTextToUser(userId, text) + : null, + }); + userAuth.setRechargeNotifier(async ({ userId, title, body, dedupeKey }) => { + await notificationDispatcher.sendRechargeSuccess({ userId, title, body, dedupeKey }); + }); const wechatAdmin = createWechatAdminService(pool, { config: wechatMpConfig, scheduleEnabled: process.env.H5_SCHEDULE_ENABLED === '1',