local user_router = require"router_group.user_router" local role_router = require"router_group.role_router" local monitor_router = require"router_group.monitor_router" local realtimelist_router = require"router_group.realtimelist_router" local warnlog_router = require"router_group.warnlog_router" local dashboard_router = require"router_group.dashboard_router"
local rsp_body = require"common.rsp_body" local frpc_client = require"skynet-fly.client.frpc_client" locallog = require"skynet-fly.log"
localassert = assert localtonumber = tonumber
returnfunction(group) group:get('/info',function(c) local query = c.req.query local pre_day = assert(query.pre_day,"not pre_day") --前几天 pre_day = tonumber(pre_day) local instance = frpc_client:instance("logserver","warn_m"):set_svr_id(1) local ret = instance:byid_mod_call('read', pre_day) local context = ret.result log.info("warnlog_router:", context) local result = nil if context then result = "OK" context = context[1] else context = "无" end rsp_body.set_rsp(c,{ result = result, context = context }) end) end