为广告信息添加x,y偏移量记录

This commit is contained in:
pengtao 2019-08-19 11:50:51 +08:00
parent a0ca5905c8
commit e1d41788ab
2 changed files with 13 additions and 3 deletions

View File

@ -201,7 +201,7 @@ http://154.8.214.202:5015/interface/location?gameid=1004
"code": 200,
"message": [
{
"area": "1,8,15",
"area": "1,8,15,0,0",
"channelid": 6001,
"gameid": 1004,
"id": 1007,
@ -228,7 +228,8 @@ http://154.8.214.202:5015/interface/location?gameid=1003&area=1,1,1&type=1&mode=
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------------------------------------------------------------ |
| area | string | 是 | 区域(第一元素1=首页2=游戏中3=结算页4=关闭第二元素X轴第三元素Y轴其中X,Y取值范围0,15)如1,0,0代表首页左上 |
| area | string | 是 | 区域(第一元素1=首页2=游戏中3=结算页4=关闭第二元素X轴第三元素Y轴其中X,Y取值范围0,15)如1,0,0代表首页左上 ,第四、五元素代表x,
y轴偏移量|
| type | int | 是 | 类型1=icon2=banner3=浮窗) |
| mode | int | 是 | 广告单播或轮播模式1=单播2=轮播) |
| gameid | int | 是 | 游戏ID |

View File

@ -87,6 +87,15 @@ def send_cache_data():
'jump_param'], item['ad_sort'], item['companyid'], item['gameid'], item['channelid'], item[
'jump_status'], item['ad_property'], item['area'], item['type'], item['mode'], item[
'locationid'] = line
try:
item['x_offset'] = item['area'].split(',')[-2].strip()
except:
item['x_offset'] = 0
try:
item['y_offset'] = item['area'].split(',')[-1].strip().strip(')')
except:
item['y_offset'] = 0
all.append(item)
except Exception:
log.error("split data failed", exc_info=True)
@ -121,7 +130,7 @@ def send_cache_data():
for item in remove_list:
line.pop(item)
my_redis.hmset(f"ad::{line['id']}::info", line)
my_redis.expire(f"ad::{line['id']}::info", 3600)
my_redis.expire(f"ad::{line['id']}::info", 60)
# my_redis.expire(f"ad::{line['id']}::info", 3600 * 24 * 7)
log.info(f"add ad::{line['id']}::info to redis!")