fix: wire admin recharge WeChat notifications
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user