方法字段接口添加是否需要排序字段(默认为0)
This commit is contained in:
parent
6e76875505
commit
43df9a16f7
20
Readme.md
20
Readme.md
@ -38,25 +38,25 @@ http://154.8.214.202:5022/webapp/index.php?c=Ops&a=getmethods&gameid=2001
|
||||
| methods | String | 是 | 方法名 |
|
||||
| methods_name | String | 是 | 方法显示名 |
|
||||
| result | json | 是 | 方法明细字段名称及显示名 |
|
||||
|need_sort|int|是|作为排序的字段|
|
||||
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "",
|
||||
"result": [
|
||||
{
|
||||
"methods": "tap_2001",
|
||||
"fields": "name",
|
||||
"comment": "点击按钮名称"
|
||||
},
|
||||
{
|
||||
"methods": "tap_2001",
|
||||
"methods": "stage",
|
||||
"method_display": "关卡通关记录",
|
||||
"need_sort": 0,
|
||||
"fields": "num",
|
||||
"comment": "次数"
|
||||
"comment": "通关次数"
|
||||
},
|
||||
{
|
||||
"methods": "tap_2001",
|
||||
"fields": "dis_num",
|
||||
"comment": "人数"
|
||||
"methods": "stage",
|
||||
"method_display": "关卡通关记录",
|
||||
"need_sort": 0,
|
||||
"fields": "level",
|
||||
"comment": "关卡数"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
# pip install apscheduler
|
||||
# python data_collect_interface.py --port=5021
|
||||
# 广告数据接口
|
||||
# 请求方式为 http://154.8.214.202:5020/webapp/index.php?c=Ops&a=gamereport1004&body={"times":"2019-07-22","is_new":0}
|
||||
# 请求方式为 http://154.8.214.202:5022/webapp/index.php?c=Ops&a=gamereport1004&body={"times":"2019-07-22","is_new":0}
|
||||
|
||||
import tornado.ioloop
|
||||
import tornado.httpserver
|
||||
@ -50,7 +50,8 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
a.method_display,
|
||||
a.need_sort,
|
||||
b.fields,
|
||||
b.comment
|
||||
b.comment,
|
||||
b.sort_num
|
||||
FROM
|
||||
(SELECT
|
||||
method_name,
|
||||
@ -65,6 +66,7 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
(SELECT
|
||||
method_name,
|
||||
fields,
|
||||
sort_num,
|
||||
comment
|
||||
FROM
|
||||
methods_detail )b
|
||||
@ -76,7 +78,8 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
for line in data:
|
||||
temp = {}
|
||||
try:
|
||||
temp['methods'], temp['method_display'],temp['need_sort'],temp['fields'], temp['comment'] = line
|
||||
temp['methods'], temp['method_display'],temp['need_sort'],temp['fields'], temp['comment'],\
|
||||
temp['sort_num'] = line
|
||||
output.append(temp)
|
||||
except Exception:
|
||||
log.error(f"split {line} error, get data from methods!", exc_info=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user