为广告信息添加x,y偏移量记录
This commit is contained in:
parent
a0ca5905c8
commit
e1d41788ab
@ -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=icon,2=banner,3=浮窗) |
|
||||
| mode | int | 是 | 广告单播或轮播模式(1=单播,2=轮播) |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
|
11
ad_tasks.py
11
ad_tasks.py
@ -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!")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user