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