添加漫画签到接口、积分商城相关接口 (#335)

* 添加漫画签到接口

* 添加积分商城相关接口

* 添加基本兑换状态码

* fix format

Co-authored-by: 社会易姐QwQ <45892418+SocialSisterYi@users.noreply.github.com>
This commit is contained in:
7rikka 2022-03-24 16:42:58 +08:00 committed by GitHub
parent 39fc33cfe3
commit af340e3eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 521 additions and 1 deletions

View File

@ -191,7 +191,10 @@ PS所有 rest api 均可使用 https文档中为了统一写作`http`
- [ ] 基本信息
- [ ] B币充值
- [ ] 贝壳相关
- [ ] 哔哩哔哩漫画
- [ ] [哔哩哔哩漫画](manga)
- [x] [签到](manga/clockin.md)
- [x] [积分商城](manga/point_shop.md)
- [ ] 哔哩哔哩游戏
- [ ] 轻视频
- [ ] [终端网络查询](clientinfo)

66
manga/ClockIn.md Normal file
View File

@ -0,0 +1,66 @@
# 签到
> http://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| platform | str | 平台 | 必要 | android |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num / str | 返回值 | 0成功<br />invalid_argument今日已签到 |
| msg | str | 错误信息 | 成功:空<br />已签到clockin clockin is duplicate |
| meta | obj | 错误信息 | 今日已签到时存在 |
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| data | str | 错误信息 | |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn' \
-b 'SESSDATA=xxx'
```
<details>
<summary>签到成功:</summary>
```json
{
"code": 0,
"msg": "",
"data": {}
}
```
</details>
<details>
<summary>今日已签到:</summary>
```json
{
"code": "invalid_argument",
"msg": "clockin clockin is duplicate",
"meta": {
"argument": "clockin"
}
}
```
</details>

451
manga/point_shop.md Normal file
View File

@ -0,0 +1,451 @@
# 积分商城
- [获取当前持有点数](#获取当前持有点数)
- [获取兑换奖品列表](#获取兑换奖品列表)
- [兑换物品](#兑换物品)
- [获取兑换历史记录](#获取兑换历史记录)
- [获取玩法说明](#获取玩法说明)
*积分商城由web页面提供功能地址为*
> https://manga.bilibili.com/eden/credits-exchange.html
## 获取当前持有点数
> http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetUserPoint
*请求方式POST*
认证方式CookieSESSDATA/ APP
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| point | str | 点数 | 不登录时为0 |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetUserPoint' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"point": "66666"
}
}
```
</details>
## 获取兑换奖品列表
> http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/ListProduct
*请求方式POST*
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | array | 奖品列表 | |
`data`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | --------- | ---- |
| 0 | obj | 奖品1 | |
| n | obj | 奖品(n+1) | |
| …… | obj | …… | …… |
`data`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| id | num | 物品id | |
| type | num | 物品类型 | 0商城相关<br />3限免券<br />7福利券 |
| title | str | 物品名 | |
| image | str | 显示的图像 | 福利券为空 |
| amount | num | 库存总量 | |
| cost | num | 兑换所需点数(原价) | |
| real_cost | num | 兑换所需点数(现价) | |
| remain_amount | num | 库存剩余数 | |
| comic_id | num | 相关漫画id | |
| limits | array | 限定使用范围(漫画) | 限免券所适用的漫画 |
| discount | num | (?) | 目前恒为0 |
| product_type | num | 物品类型 | 1限免券、福利券<br />4商城满99立减10元券、商城5元无门槛券<br />5商城5魔晶 |
| pendant_url | str | (?) | |
| pendant_expire | num | (?) | 0限免券、福利券<br />7商城满99立减10元券、商城5元无门槛券、商城5魔晶 |
| exchange_limit | num | 兑换次数限制 | |
| address_deadline | str | (?) | |
| act_type | num | (?) | 目前恒为0 |
| has_exchanged | bool | 是否兑换过该物品 | |
| main_coupon_deadline | str | 兑换后使用截止时间 | |
| deadline | str | 兑换后使用截止时间 | |
| point | str | (?) | 目前恒为0 |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/ListProduct'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": [
{
"id": 195,
"type": 7,
"title": "积分兑换",
"image": "",
"amount": 15999,
"cost": 200,
"real_cost": 100,
"remain_amount": 0,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 1,
"pendant_url": "",
"pendant_expire": 7,
"exchange_limit": 0,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "0001-01-01T00:00:00Z",
"deadline": "",
"point": "0"
},
{
"id": 1009,
"type": 0,
"title": "商城5魔晶",
"image": "",
"amount": 500,
"cost": 260,
"real_cost": 30,
"remain_amount": 0,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 5,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1008,
"type": 0,
"title": "商城满99立减10元券",
"image": "",
"amount": 400,
"cost": 2000,
"real_cost": 400,
"remain_amount": 390,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 4,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1007,
"type": 0,
"title": "商城5元无门槛券",
"image": "",
"amount": 200,
"cost": 1000,
"real_cost": 200,
"remain_amount": 134,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 4,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1536,
"type": 3,
"title": "白兔糖",
"image": "http://i0.hdslb.com/bfs/manga-static/c3369754789a77b5d0b15cc31c75538ac035b3aa.jpg",
"amount": 4000,
"cost": 100,
"real_cost": 75,
"remain_amount": 3991,
"comic_id": 27164,
"limits": [
{
"type": 1,
"id": 27164,
"title": "白兔糖"
}
],
"discount": 0,
"product_type": 1,
"pendant_url": "",
"pendant_expire": 7,
"exchange_limit": 0,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "0001-01-01T00:00:00Z",
"deadline": "",
"point": "0"
}
]
}
```
</details>
## 兑换物品
> http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/Exchange
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded 或 application/json**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| product_id | str | 物品id | 必要 | |
| product_num | num | 兑换个数 | 必要 | |
| point | num | 物品所需点数 | 必要 | 现价real_cost |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0兑换成功<br />1积分不足<br />2库存不足<br />3product point mismatchpoint填写错误<br />3超过用户最大可兑换数量<br />4现在抢票的人太多啦再点一下有机会优先上车喔 ε=ε=(ノ≧∇≦) |
| message | str | 错误信息 | |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/Exchange' \
--data-urlencode 'product_id=195' \
--data-urlencode 'product_num=1' \
--data-urlencode 'point=real_cost' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": ""
}
```
</details>
## 获取兑换历史记录
> http://manga.bilibili.com/twirp/activity.v1.Activity/GetPrizeList
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded 或 application/json**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| act_id | num | 固定值90018 | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | | |
| data | obj | 信息本体 |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ------ | ---- | -------- | ---- |
| prizes | obj | 兑换记录 | |
| addr | obj | (?) | |
`data`中的`prizes`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| user_prize_id | str | 兑换id? | |
| prize_id | num | 兑换的物品id | |
| ctime | str | 兑换时间 | |
| addr | null | (?) | |
| deadline | str | 过期时间 | |
| type | num | 类型 | 1限免券、福利券<br />8商城5魔晶 |
| name | str | 物品名 | |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/activity.v1.Activity/GetPrizeList' \
--data-urlencode 'act_id=90018' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"prizes": [
{
"user_prize_id": "55117444",
"prize_id": 1009,
"ctime": "2022-03-21T12:22:53+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 8,
"name": "商城5魔晶"
},
{
"user_prize_id": "2594073385420523088",
"prize_id": 1536,
"ctime": "2022-03-21T12:07:24+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "白兔糖限免卡"
},
{
"user_prize_id": "4899916394614914913",
"prize_id": 195,
"ctime": "2021-12-24T12:01:08+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "积分兑换"
},
{
"user_prize_id": "1152921504636496551",
"prize_id": 195,
"ctime": "2021-12-13T12:05:13+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "积分兑换"
}
],
"addr": {
"name": "",
"phone": "",
"address": "",
"id_card": ""
}
}
}
```
</details>
## 获取玩法说明
> http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetExchangeRule
*请求方式POST*
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| rule | str | 玩法说明 | |
**示例:**
```bash
curl 'http://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetExchangeRule'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"rule": "日常兑换说明:\n1、赛季积分达到一定数量可兑换积分商城内相应的商品\n2、日常兑换奖品的刷新时间为每日中午12点每天可兑换的奖品总数有限具体可见商品页面展示请尽快兑换。\n3、兑换的福利券限免卡奖品有效期详见兑换框内显示或卡券包内详情说明哦请及时在有效期内使用。\n4、赛季积分有效期为当前赛季时长每期赛季时长详见福利中心页面倒计时显示请及时在有效期内进行使用。\n5、赛季积分可在福利中心完成特定任务获取具体详情可至福利中心查看部分活动也可获取赛季积分可随时关注活动信息哦。"
}
}
```
</details>