Add wechat reminder LLM admin toggle
This commit is contained in:
+22
-1
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user