调整位置服务接口
This commit is contained in:
parent
3ba71f7216
commit
a6ec54f42f
220
README.MD
220
README.MD
@ -196,12 +196,13 @@ http://154.8.214.202:5015/interface/location
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ---- | ---- | --------------------------------------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 是 | 渠道ID,默认是6001 |
|
||||
| area | int | 否 | 游戏区域 (1=首页,2=游戏中,3=结算页,4=关闭) |
|
||||
| | int | 否 | 类型(1=icon,2=banner,3=浮窗) |
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ----------- | ---- | ---- | --------------------------------------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 是 | 渠道ID,默认是6001 |
|
||||
| area | int | 是 | 游戏区域 (1=首页,2=游戏中,3=结算页,4=关闭) |
|
||||
| type | int | 是 | 类型(1=icon,2=banner,3=浮窗,4=icon2) |
|
||||
| localtionid | int | 是 | 位置ID |
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
@ -560,210 +561,3 @@ http://154.8.214.202:5015/interface/area
|
||||
"code": 200
|
||||
}
|
||||
|
||||
#### 14、变更区域
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/area
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:put
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/area
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ------ | ---- | --------------------------------------------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 是 | 渠道ID,默认为6001 |
|
||||
| areaid | int | 是 | 区域ID |
|
||||
| areaname | string | 是 | 区域说明 |
|
||||
| status | int | 否 | 默认为0(未审批),1=审批通过,2=审批未通过,3=暂停 |
|
||||
| | string | 是 | 区域示意图 |
|
||||
|
||||
#####
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
||||
|
||||
#### 15、查询区域
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/area
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:get
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/area
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ---- | ---- | ----------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 否 | 渠道ID 默认为6001 |
|
||||
|
||||
返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
||||
|
||||
#### 16、新建类型
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:post
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ------ | ---- | --------------------------------------------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 否 | 渠道ID,默认为6001 |
|
||||
| typeid | int | 是 | 类型ID |
|
||||
| typename | string | 是 | 类型描述文字 |
|
||||
| status | int | 否 | 默认为0(未审批),1=审批通过,2=审批未通过,3=暂停 |
|
||||
| url | string | 是 | 类型示例图 |
|
||||
|
||||
#####
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
||||
|
||||
#### 17、删除按钮类型
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:delete
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------------- |
|
||||
| id | int | 是 | 需删除的位置ID |
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
||||
#### 18、变更按钮类型
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:put
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------------- |
|
||||
| id | int | 是 | 需删除的位置ID |
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
||||
#### 19、查询按钮类型
|
||||
|
||||
##### 接口地址
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 返回格式:json
|
||||
|
||||
##### 请求方式:get
|
||||
|
||||
##### 请求示范
|
||||
|
||||
http://154.8.214.202:5015/interface/type
|
||||
|
||||
##### 请求参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| --------- | ---- | ---- | ----------------- |
|
||||
| gameid | int | 是 | 游戏ID |
|
||||
| channelid | int | 否 | 渠道ID 默认为6001 |
|
||||
|
||||
|
||||
|
||||
##### 返回参数说明
|
||||
|
||||
| 名称 | 类型 | 必填 | 说明 |
|
||||
| ---- | ---- | ---- | -------- |
|
||||
| code | int | 是 | 返回状态 |
|
||||
|
||||
##### 返回示例
|
||||
|
||||
{
|
||||
"code": 200
|
||||
}
|
@ -16,7 +16,8 @@ parser.add_argument('id')
|
||||
parser.add_argument('area')
|
||||
parser.add_argument('type')
|
||||
parser.add_argument('in_used')
|
||||
|
||||
parser.add_argument('gameid')
|
||||
parser.add_argument('channelid')
|
||||
|
||||
class Location(Resource):
|
||||
def __init__(self):
|
||||
@ -25,7 +26,10 @@ class Location(Resource):
|
||||
|
||||
|
||||
def get(self):
|
||||
sql = f"select id,area,type from location where in_used=1;"
|
||||
gameid = self.args['gameid']
|
||||
channelid = self.args['channelid'] or 6001
|
||||
sql = f"select gameid,channelid,id,area,type from location where gameid={gameid} and channelid={channelid} " \
|
||||
f"and in_used=1;"
|
||||
try:
|
||||
data = self.mydb.query(sql)
|
||||
except Exception:
|
||||
@ -37,7 +41,8 @@ class Location(Resource):
|
||||
for line in data:
|
||||
if line:
|
||||
localtion = {}
|
||||
localtion['id'], localtion['area'], localtion['type'] = line
|
||||
localtion['gameid'], localtion['channelid'], localtion['id'], localtion['area'], localtion[
|
||||
'type'] = line
|
||||
all_data.append(localtion)
|
||||
del localtion
|
||||
return jsonify({'code': 200, 'message': all_data})
|
||||
@ -51,6 +56,8 @@ class Location(Resource):
|
||||
location = {}
|
||||
location['area'] = self.args['area']
|
||||
location['type'] = self.args['type']
|
||||
location['gameid'] = self.args['gameid']
|
||||
location['channelid'] = self.args['channelid'] or 6001
|
||||
location['id'] = self.create_id()
|
||||
self.mydb.insert("location", location)
|
||||
except Exception:
|
||||
@ -78,7 +85,9 @@ class Location(Resource):
|
||||
location['id'] = self.args['id']
|
||||
location['area'] = self.args['area']
|
||||
location['type'] = self.args['type']
|
||||
location['in_used'] = self.args['in_used'] or 0
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user