1234567891011121314151617181920 |
- local skynet = require "skynet"
- local s = require "service"
- local tools = require "tools"
- local cjson = require "cjson"
- local httpc = require "http.httpc"
- local runconfig = require "run_config"
- s.resp.on_recv = function (source, fd, msg_id, msg_body)
- skynet.error("接收一条工具消息 ",msg_id)
- local func = string.gsub(msg_id, "/tools/", "")
- if s.resp[func] ~=nil then
- return s.resp[func](fd,msg_body)
- end
- return tools.response(fd,200,string.format("接口 %s 不存在",func))
- end
- s.start(...)
|