Add wechat reminder LLM admin toggle

This commit is contained in:
john
2026-07-07 12:10:21 +08:00
parent ebcc33b367
commit b9cadd91fc
6 changed files with 79 additions and 1 deletions
+22 -1
View File
@@ -97,6 +97,7 @@ export function createAdminApp(services) {
loadMindSpaceConfig,
updateMindSpaceConfig,
memoryV2ConfigService,
wechatScheduleLlmConfigService,
adminSystemTestService,
systemTestAccountService,
wordFilterService,
@@ -285,7 +286,27 @@ export function createAdminApp(services) {
adminApi.get('/wechat/summary', requireAdmin, async (_req, res) => {
if (!wechatAdmin) return res.status(503).json({ message: '服务号管理未启用' });
res.json(await wechatAdmin.getSummary());
const summary = await wechatAdmin.getSummary();
const scheduleLlmConfig = wechatScheduleLlmConfigService
? await wechatScheduleLlmConfigService.getConfig()
: { scheduleLlmEnabled: false };
res.json({
...summary,
config: {
...summary.config,
scheduleLlmEnabled: scheduleLlmConfig.scheduleLlmEnabled,
},
});
});
adminApi.patch('/wechat/schedule-llm-config', requireAdmin, async (req, res) => {
if (!wechatScheduleLlmConfigService) {
return res.status(503).json({ message: '服务号提醒 LLM 配置未启用' });
}
const result = await wechatScheduleLlmConfigService.updateConfig(req.body ?? {}, {
updatedBy: req.currentUser.id,
});
res.json(result);
});
adminApi.get('/mindspace/config', requireAdmin, async (_req, res) => {