add user_online interface
This commit is contained in:
parent
473c466e0d
commit
b414877348
@ -17,10 +17,17 @@ else:
|
||||
|
||||
if not interface_port:
|
||||
interface_port = 6500
|
||||
|
||||
online_mysql = {
|
||||
"host": '10.10.3.5',
|
||||
"user": 'ops',
|
||||
"pswd": 'deploy2018',
|
||||
"db": 'user_online'
|
||||
}
|
||||
if os.getenv("IS_DEBUG"):
|
||||
online_mysql = {
|
||||
"host": '127.0.0.1',
|
||||
"user": 'root',
|
||||
"pswd": 'aspect',
|
||||
"db": 'user_online'
|
||||
}
|
||||
else:
|
||||
online_mysql = {
|
||||
"host": '10.10.3.5',
|
||||
"user": 'ops',
|
||||
"pswd": 'deploy2018',
|
||||
"db": 'user_online'
|
||||
}
|
||||
|
15
env.py
Normal file
15
env.py
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding:utf-8 _*-
|
||||
"""
|
||||
@author: pengtao
|
||||
@file: env.py
|
||||
@time: 2020/03/20
|
||||
"""
|
||||
import os
|
||||
|
||||
|
||||
if os.getenv("IS_DEBUG"):
|
||||
is_debug = True
|
||||
else:
|
||||
is_debug = False
|
||||
is_debug = True
|
11
web.py
11
web.py
@ -16,8 +16,10 @@ from data_channel.mp2shushu import Mp2shushu
|
||||
from deploy.deploy_keys import DeployKeys
|
||||
from deploy.clear_service_data import ClearService
|
||||
from online.online_data import OnlineData2mysql
|
||||
import json
|
||||
|
||||
define_logger("/data/logs/myops/ops_interface.log")
|
||||
|
||||
define_logger("ops_interface.log")
|
||||
log = logging.getLogger(__name__)
|
||||
tornado.options.define("port", default=interface_port, type=int, help="run server on the given port.")
|
||||
|
||||
@ -44,8 +46,11 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
# if self.get_query_argument('c') == 'Ops' and self.get_query_argument('a') == 'upJumpRecording':
|
||||
# self._selfupJumpRecording()
|
||||
def _user_online(self):
|
||||
data = self.get_query_argument('accountid')
|
||||
aa = OnlineData2mysql(data)
|
||||
param = self.request.body.decode('utf-8')
|
||||
prarm = json.loads(param)
|
||||
log.info(f"get user_online prarm was {prarm}")
|
||||
# data = self.get_query_argument('data')
|
||||
aa = OnlineData2mysql(prarm)
|
||||
aa.run()
|
||||
|
||||
def _selfdeploykeys(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user