调整接口上传内容

This commit is contained in:
pengtao 2019-09-24 14:48:42 +08:00
parent 3b1059c949
commit 8cb3c0016c
2 changed files with 43 additions and 36 deletions

View File

@ -48,22 +48,29 @@ http://spread-test.kingsome.cn/webapp/index.php?c=Ops&a=getAdList&body={"gameid"
"message": {
"totoal": 1,
"result": [
{
"ad_body": "33",
"ad_image": "https://resource.kingsome.cn//ad/1d7bb7a2-a865-11e9-8df4-525400ddcafb_banner12(1).png",
"ad_sort": "0",
"ad_title": "333",
"area": "1,0,0",
"channelid": "6001",
"companyid": "1002",
"id": "1014",
"jump_param": "fdfd",
"jump_status": "0",
"locationid": "1001",
"mode": "0",
"name": "33",
"type": "1"
}
{
"ad_body": "",
"ad_image": "https://resource.kingsome.cn/ad/b63dd2ca-dad5-11e9-9ea2-525400ddcafb_png",
"ad_property": "{\"is_shake\":0,\"is_hot\":0,\"is_new\":0,\"is_recommend\":0,\"appid\":\"wxdb103a128e118619\",\"jump_param\":\"yx2nyabgm8\",\"played\":0}",
"ad_sort": "0",
"ad_title": "",
"area": "3,8,12,0,32",
"channelid": "6001",
"companyid": "0",
"createtime": "2019-09-20 10:42:42",
"id": "1258",
"jump_param": "",
"jump_status": "1",
"ld_property": "{\"title\":\"底部横向滚动\",\"show_name\":\"\",\"bg_img\":\"\",\"has_dot\":false,\"is_shake\":false,\"is_hide\":true,\"is_show_name\":false,\"related\":[],\"scale\":1}",
"locationid": "1073",
"mode": "1",
"name": "首页icon轮播+底部横向滚动6",
"type": "6",
"x": "8",
"x_offset": "0",
"y": "12",
"y_offset": "32"
},
]
}
}
@ -140,8 +147,10 @@ https://spread-test.kingsome.cn/webapp/index.php?c=Ops&a=upJumpRecording
| c | string | 是 | OPS通用接口标志 |
| a | string | 是 | 方法定义 upJumpRecording |
| gameid | int | 是 | 游戏ID |
| channelid | int | 是 | 平台ID |
| body | string | 是 | 广告属性json (area,locationid,ad_channel,appid) |
| locationid | int | 是 | 广告位置ID |
| uid | int | 是 | 用户ID或微信openid |
| ad_channel | int | 是 | 广告特征码 见上ad_property.jump_param |
| aid | int | 是 | 广告ID |
##### 返回参数说明

View File

@ -44,15 +44,18 @@ class DispatchHandler(tornado.web.RequestHandler):
self._selfupJumpRecording()
def _selfupJumpRecording(self):
# {"area":"2,0,5,0,0","locationId":"1011","ad_channel":"wxxssss","appid":"sss"}
"""| gameid | int | 是 | 游戏ID |
| locationid | int | | 广告位置ID |
| uid | int | | 用户ID或微信openid |
| ad_channel | int | | 广告特征码 见上ad_property.jump_param |
| aid | int | | 广告ID |
"""
try:
body = unquote(self.get_query_argument('body'), 'utf-8')
gameid = self.get_query_argument('gameid')
channelid = self.get_query_argument('channelid')
area = json.loads(body)['area']
locationid = json.loads(body)['locationid']
ad_channel = json.loads(body)['ad_channel']
appid = json.loads(body)['appid']
locationid = self.get_query_argument('locationid')
uid = self.get_query_argument('uid')
ad_channel = self.get_query_argument('ad_channel')
aid = self.get_query_argument('aid')
except Exception as e:
result = {'errcode': 2, "errmsg": f"get args failed,{str(e)}"}
@ -76,25 +79,20 @@ class DispatchHandler(tornado.web.RequestHandler):
self.event_type = "jump_recording"
try:
tga_data = {}
tga_data['ad_channel'] = channelid
tga_data['account_id'] = gameid
tga_data['gameid'] = channelid
tga_data['date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
tga_data['area'] = area
tga_data['locationid'] = locationid
tga_data['ad_channel'] = ad_channel
tga_data['appid'] = appid
tga_data['account_id'] = uid
tga_data['gameid'] = gameid
tga_data['date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
tga_data['locationid'] = locationid
tga_data['aid'] = aid
self.tga.put_event_data(tga_data, f'rep_{self.event_type}')
return self.write({'errcode': 0, "errmsg": '', "message": ""})
except Exception:
log.error(f"write 2 tga failed!,context={body}", exc_info=True)
log.error(f"write 2 tga failed!", exc_info=True)
return self.write_error(2)
def _selfGetLocation(self):
try:
input = json.loads(self.get_query_argument('body'))