'use strict'; function getRealStateData(opts) { return async function (ctx, next) { const models = ctx.fs.dc.models; let errMsg = { message: '获取水务实时态势数据失败' } try { const res = await models.FloodControlHeadquarters.findAll(); ctx.status = 200; ctx.body = res; } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = errMsg } } } module.exports = { getRealStateData }