promotion/README.MD
2019-09-12 14:23:46 +08:00

527 lines
15 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 推广系统接口文档
TODO
区域/类型 增删改检查的接口
#### 1、获得公司列表
##### 接口地址
http://154.8.214.202:6015/interface/company
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:6015/company
http://154.8.214.202:6015/interface/company?status=0
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------ | ---- | ---- | ---------------------------------- |
| status | int | 否 | 0=未审批1=审批通过2=审批未通过 |
| id | int | 否 | 返回该id对应公司信息 |
| | | | 上述参数为空返回所有信息 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---- | ---------------- |
| id | int | 否 | 自动产生的公司ID |
| name | string | 是 | 公司名称 |
| contact | string | 是 | 联系人 |
| user | string | 是 | 登录账号 |
| tel | int | 是 | 联系电话 |
| companyid | string | 是 | 公司标识 |
| companykey | string | 是 | 用于API认证 |
##### 返回示例
{
"code": 200,
"message": [
{
"appid": "BKadJbmZ",
"appkey": "undefined",
"contact": "pt",
"id": "1001",
"name": "kings",
"status": 0,
"tel": "1234",
"user": "None"
}
]
}
#### 2、新增公司信息
##### 接口地址
http://154.8.214.202:6015/interface/company
##### 返回格式json
##### 请求方式post
##### 请求示范
http://154.8.214.202:6015/interface/company?name=kings&contact=pt&tel=1234
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | -------- |
| name | string | 是 | 公司名称 |
| contact | string | 是 | 联系人 |
| tel | string | 是 | 联系电话 |
| user | string | 是 | 登录账号 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
| | | | |
##### 返回示例
{
"code": 200
}
#### 3、更改公司信息
##### 接口地址
http://154.8.214.202:6015/interface/company
##### 返回格式json
##### 请求方式put
##### 请求示范
http://154.8.214.202:6015/interface/company?appid=zpoHY37u&appkey=undefined&contact=miles001&id=1006&name=kingsome&status=1&tel=17771&user=assd
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | -------------- |
| name | string | 是 | 公司名称 |
| contact | string | 是 | 联系人 |
| tel | string | 是 | 联系电话 |
| user | string | 是 | 登录账号 |
| id | int | 是 | 公司id(唯一值) |
| appid | string | 是 | 公司标识 |
| appkey | string | 是 | 认证用,暂无 |
| status | int | 是 | 审批状态 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
| | | | |
##### 返回示例
{
"code": 200
}
#### 4、删除公司信息
##### 接口地址
http://154.8.214.202:6015/interface/company
##### 返回格式json
##### 请求方式delete
##### 请求示范
http://154.8.214.202:6015/interface/company?id=1006
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------------- |
| id | int | 是 | 公司id(唯一值) |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
| | | | |
##### 返回示例
{
"code": 200
}
#### 5、返回位置服务信息
##### 接口地址
http://154.8.214.202:6015/interface/location
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:6015/interface/location?gameid=1001
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ---- | ---- | ------------------ |
| gameid | int | 是 | 游戏ID |
| channelid | int | 是 | 渠道ID默认是6001 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------- | ---- | ---- | ------------ |
| code | int | 是 | 返回状态 |
| message | json | 是 | 所有位置信息 |
##### 返回示例
{
"code": 200,
"message": [
{
"area": "1,8,15,0,0",
"channelid": 6001,
"gameid": 1004,
"id": 1007,
"mode": 1,
"type": 2
}
]
}
#### 6、添加位置服务信息
##### 接口地址
http://154.8.214.202:6015/interface/location
##### 返回格式json
##### 请求方式post
##### 请求示范
http://154.8.214.202:6015/interface/location?gameid=1001&area=3&type=1&mode=2&x=2&y=2&x_offset=4&y_offset=5&channelid=6001&id_property={"a":1,"b":2}
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------------------------------------------------------------ |
| area | string | 是 | 区域(支持多值,表明页面位置|
|x|int|是|X轴坐标|
|y|int|是|y轴坐标|
|x_offset|int|是|X坐标偏移量|
|y_offset|int|是|Y坐标偏移量|
| type | int | 是 | 类型1=icon2=banner3=浮窗) |
| mode | int | 是 | 广告单播或轮播模式1=单播2=轮播) |
| gameid | int | 是 | 游戏ID |
| channelid | int | 是 | 渠道ID |
|ld_propert|string|是|位置的属性|
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 7、变更位置服务信息
##### 接口地址
http://154.8.214.202:6015/interface/location
##### 返回格式json
##### 请求方式put
##### 请求示范
http://154.8.214.202:6015/interface/location?gameid=1001&area=3&type=1&mode=2&x=2&y=2&x_offset=4&y_offset=5&id=1004&channelid=6001&ld_property={"a":1,"b":2}&in_used=1
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------------------------------------------------------------ |
| area | string | 是 | 区域(支持多值,表明页面位置|
|x|int|是|X轴坐标|
|y|int|是|y轴坐标|
|x_offset|int|是|X坐标偏移量|
|y_offset|int|是|Y坐标偏移量|
| type | int | 是 | 类型1=icon2=banner3=浮窗) |
| mode | int | 是 | 广告单播或轮播模式1=单播2=轮播) |
| gameid | int | 是 | 游戏ID |
| channelid | int | 是 | 渠道ID |
|in_used|int|否|是否使用默认为1|
|ld_propert|string|是|位置的属性|
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 8、删除位置服务信息
##### 接口地址
http://154.8.214.202:6015/interface/location
##### 返回格式json
##### 请求方式delete
##### 请求示范
http://154.8.214.202:6015/interface/location?id=1004
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------------- |
| id | int | 是 | 需删除的位置ID |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 9、添加广告信息
##### 接口地址
http://154.8.214.202:6015/interface/prometion
##### 返回格式json
##### 请求方式post
##### 请求示范
http://154.8.214.202:6015/interface/promotion?name=abc&gameid=1003&locationid=1007&ad_title=hello&ad_body=hi world&ad_image=http://1&ad_url=http://2&companyid=2&ad_property={is_shake:1}&jump_status=1
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ----------- | -------- | ---- | ------------------------------------------------------- |
| name | string | 是 | 广告名称 |
| gameid | int | 是 | 广告投放的游戏ID |
| channelid | int | 是 | 渠道ID默认是6001 NEW |
| locationid | int | 是 | 位置ID通过该ID到localtion表中获得areatypemode信息 |
| ad_title | string | 是 | 广告标题 |
| ad_body | string | 是 | 广告正文 |
| ad_image | string | 是 | 头像链接 |
| ad_url | string | 是 | 跳转链接 |
| begin_time | datetime | 否 | 开始时间默认是1999-01-01 |
| end_time | datetime | 否 | 结束时间默认是3000-01-01 |
| ad_num | int | 否 | 投放次数默认是0(次数无限) |
| ad_sort | int | 否 | 优先级默认为0 |
| status | int | 否 | 默认为0未审批1=审批通过2=审批未通过3=暂停 |
| companyid | int | 是 | 广告提交公司 |
| ad_property | json | 是 | 广告属性描述 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 10、变更广告信息审批
##### 接口地址
http://154.8.214.202:6015/interface/promotion
##### 返回格式json
##### 请求方式put
##### 请求示范
http://154.8.214.202:6015/interface/promotion?name=abc&gameid=1003&locationid=1&ad_title=hello&ad_body=hi world&ad_image=http://1&ad_url=http://2&begin_time=2019-06-01&end_time=2019-12-01&ad_num=300&ad_sort=1&status=1&id=1001&companyid=2
##### 请求参数说明
#####
| 名称 | 类型 | 必填 | 说明 |
| ----------- | -------- | ---- | --------------------------------------------------- |
| id | int | 是 | 广告ID |
| name | string | 是 | 广告名称 |
| gameid | int | 是 | 广告投放的游戏ID |
| channelid | int | 是 | 渠道ID默认是6001 NEW |
| locationid | int | 是 | 位置ID |
| ad_title | string | 是 | 广告标题 |
| ad_body | string | 是 | 广告正文 |
| ad_image | string | 是 | 头像链接 |
| ad_url | string | 是 | 跳转链接 |
| begin_time | datetime | 是 | 开始时间默认是1999-01-01 |
| end_time | datetime | 是 | 结束时间默认是3000-01-01 |
| ad_num | int | 是 | 投放次数,默认是-1(无限) |
| ad_sort | int | 是 | 优先级默认为0 |
| status | int | 是 | 默认为0未审批1=审批通过2=审批未通过3=暂停 |
| companyid | int | 是 | 广告提交公司 |
| ad_property | json | 是 | 广告属性描述 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 11、删除广告信息实际将status 改为4
##### 接口地址
http://154.8.214.202:6015/interface/promotion
##### 返回格式json
##### 请求方式delete
##### 请求示范
http://154.8.214.202:6015/interface/promotion
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------------- |
| id | int | 是 | 需删除的位置ID |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200
}
#### 12、返回广告列表信息
##### 接口地址
http://154.8.214.202:6015/interface/promotion
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:6015/interface/promotion?id=1002
http://154.8.214.202:6015/interface/promotion?companyid=0
http://154.8.214.202:6015/interface/promotion?status=0
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ---- | ---- | ---------------------------------- |
| id | int | 否 | 广告ID其优先级高于其他参数 |
| companyid | int | 否 | 公司ID优先级高于status |
| status | int | 否 | 审批状态,都不填写返回所有广告信息 |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ---- | ---- | ---- | -------- |
| code | int | 是 | 返回状态 |
##### 返回示例
{
"code": 200,
"message": {
"ad_body": "hi world",
"ad_image": "http://1",
"ad_num": 300,
"ad_sort": 1,
"ad_title": "hello",
"ad_url": "http://2",
"begin_time": "Sat, 01 Jun 2019 00:00:00 GMT",
"end_time": "Sun, 01 Dec 2019 00:00:00 GMT",
"id": 1002,
"name": "abc",
"status": 0
}
}
{
"code": 200,
"message": {
"ad_body": "hi world",
"ad_image": "http://1",
"ad_num": 300,
"ad_sort": 1,
"ad_title": "hello",
"ad_url": "http://2",
"begin_time": "Sat, 01 Jun 2019 00:00:00 GMT",
"end_time": "Sun, 01 Dec 2019 00:00:00 GMT",
"id": 1002,
"name": "abc",
"status": 0
}
}
#### ad_channel 获得接口
http://mp.kingsome.cn/api/open/promotion/get-uid?game_id=8002&platform_id=6001