调整locationid 对应的区域信息
This commit is contained in:
parent
d6972e6fa8
commit
df39e302a0
14
README.MD
14
README.MD
@ -236,7 +236,7 @@ http://154.8.214.202:6015/interface/location?gameid=1001&area=2&type=1&mode=2&x=
|
||||
| type | int | 是 | 类型(1=icon,2=banner,3=浮窗) |
|
||||
| mode | int | 是 | 广告单播或轮播模式(1=单播,2=轮播) |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 否 | 渠道ID,默认是6001 |
|
||||
| channelid | int | 是 | 渠道ID |
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
@ -268,13 +268,17 @@ http://154.8.214.202:5015/interface/location?area=1&type=1&gameid=1003
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ------ | ---- | ------------------------------------------------------------ |
|
||||
| area | string | 是 | 区域(第一元素:1=首页,2=游戏中,3=结算页,4=关闭,第二元素:X轴第三元素:Y轴,其中X,Y取值范围(0,15))如(1,0,0)代表首页左上 |
|
||||
| area | string | 是 | 区域(支持多值,表明页面位置|
|
||||
|x|int|是|X轴坐标|
|
||||
|y|int|是|y轴坐标|
|
||||
|x_offset|int|是|X坐标偏移量|
|
||||
|y_offset|int|是|Y坐标偏移量|
|
||||
| type | int | 是 | 类型(1=icon,2=banner,3=浮窗) |
|
||||
| mode | int | 是 | 广告单播或轮播模式(1=单播,2=轮播) |
|
||||
| id | int | 是 | 位置ID |
|
||||
| | int | 是 | 状态 0=未审批,1=审批通过,2=审批未通过,默认为1 |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 否 | 渠道ID,默认是6001 |
|
||||
| channelid | int | 是 | 渠道ID |
|
||||
|in_used|int|否|是否使用,默认为1|
|
||||
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
|
@ -87,9 +87,10 @@ class Location(Resource):
|
||||
location['type'] = self.args['type']
|
||||
location['mode'] = self.args['mode']
|
||||
location['gameid'] = self.args['gameid']
|
||||
location['channelid'] = self.args['channelid'] or 6001
|
||||
location['channelid'] = self.args['channelid']
|
||||
location['id'] = self.create_id()
|
||||
if location['area'] and location['type'] and location['mode'] and location['gameid'] :
|
||||
if location['area'] and location['type'] and location['mode'] and location['gameid'] and location[
|
||||
'channelid']:
|
||||
self.mydb.insert("location", location)
|
||||
return jsonify({'code': 200})
|
||||
else:
|
||||
@ -126,14 +127,18 @@ class Location(Resource):
|
||||
location['gameid'] = self.args['gameid']
|
||||
location['channelid'] = self.args['channelid']
|
||||
location['in_used'] = self.args['in_used'] or 1
|
||||
sel_sql = f"select area from location where id={self.args['id']};"
|
||||
data = self.mydb.query(sel_sql)
|
||||
if data:
|
||||
condition = f"id='{self.args['id']}'"
|
||||
self.mydb.update("location", location, condition)
|
||||
return jsonify({'code': 200})
|
||||
if location['area'] and location['type'] and location['mode'] and location['gameid'] and location[
|
||||
'channelid']:
|
||||
sel_sql = f"select area from location where id={self.args['id']};"
|
||||
data = self.mydb.query(sel_sql)
|
||||
if data:
|
||||
condition = f"id='{self.args['id']}'"
|
||||
self.mydb.update("location", location, condition)
|
||||
return jsonify({'code': 200})
|
||||
else:
|
||||
return jsonify({'code': 404, 'message': f"{self.args['id']} not found in mysql!"})
|
||||
else:
|
||||
return jsonify({'code': 404, 'message': f"{self.args['id']} not found in mysql!"})
|
||||
return jsonify({'code': 500, 'message': f"someting not found in {self.args}!"})
|
||||
except Exception:
|
||||
log.error("update values to location mysql failed!", exc_info=True)
|
||||
return jsonify({'code': 500})
|
||||
|
Loading…
x
Reference in New Issue
Block a user