From 0736cff456478470c84a7c3c2ace94f9902429c8 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Wed, 30 Aug 2023 10:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E7=BB=9F=E8=AE=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/project/group.js | 16 ++++++++++++++++ api/app/lib/routes/project/index.js | 3 +++ 2 files changed, 19 insertions(+) diff --git a/api/app/lib/controllers/project/group.js b/api/app/lib/controllers/project/group.js index bead78f..7bbc8ae 100644 --- a/api/app/lib/controllers/project/group.js +++ b/api/app/lib/controllers/project/group.js @@ -318,10 +318,26 @@ async function groupStatisticOnline (ctx) { } } +async function groupStatisticAlarm (ctx) { + try { + const { models } = ctx.fs.dc; + + ctx.status = 200; + ctx.body = [] + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + module.exports = { groupList, editGroup, delGroup, groupStatistic, groupStatisticOnline, + groupStatisticAlarm, }; \ No newline at end of file diff --git a/api/app/lib/routes/project/index.js b/api/app/lib/routes/project/index.js index 395f6c2..545d829 100644 --- a/api/app/lib/routes/project/index.js +++ b/api/app/lib/routes/project/index.js @@ -45,4 +45,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/project/group/statistic/online'] = { content: '获取项目分组在线率统计信息', visible: true }; router.get('/project/group/statistic/online', projectGroup.groupStatisticOnline); + + app.fs.api.logAttr['GET/project/group/statistic/alarm'] = { content: '获取项目分组告警统计信息', visible: true }; + router.get('/project/group/statistic/alarm', projectGroup.groupStatisticAlarm); }; \ No newline at end of file