10. 【App】收藏接口
10.1. 获取当前用户的收藏集合
URL: /favorite/listMine
Type: GET
Author: Timothy
Content-Type: application/x-www-form-urlencoded
Description: 获取当前用户的收藏集合
Query-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
pageNum |
int32 |
页码 |
false |
- |
pageSize |
int32 |
页面大小 |
false |
- |
Request-example:
curl -X GET -i '/favorite/listMine?pageNum=0&pageSize=0'
Response-fields:
Field | Type | Description | Since |
---|---|---|---|
total |
int64 |
No comments found. |
- |
list |
array |
No comments found. |
- |
└─id |
int32 |
ID |
- |
└─title |
string |
标题 |
- |
└─type |
int32 |
类型(对应消息类型) |
- |
└─text |
string |
文本内容 |
- |
└─previewUrl |
string |
预览图地址 |
- |
└─sourceUrl |
string |
原媒体地址 |
- |
└─size |
int32 |
媒体大小 |
- |
└─userId |
int32 |
收藏者ID |
- |
└─senderId |
int32 |
发布者ID |
- |
└─senderNickname |
string |
发布者昵称 |
- |
└─senderAlias |
string |
发布者别名 |
- |
└─createDate |
string |
收藏时间 |
- |
pageNum |
int32 |
当前页 |
- |
pageSize |
int32 |
每页的数量 |
- |
size |
int32 |
当前页的数量 |
- |
startRow |
int64 |
由于startRow和endRow不常用,这里说个具体的用法 |
- |
endRow |
int64 |
当前页面最后一个元素在数据库中的行号 |
- |
pages |
int32 |
总页数 |
- |
prePage |
int32 |
前一页 |
- |
nextPage |
int32 |
下一页 |
- |
firstPage |
boolean |
是否为第一页 |
- |
lastPage |
boolean |
是否为最后一页 |
- |
hasPreviousPage |
boolean |
是否有前一页 |
- |
hasNextPage |
boolean |
是否有下一页 |
- |
navigatePages |
int32 |
导航页码数 |
- |
navigatepageNums |
array |
所有导航页号 |
- |
navigateFirstPage |
int32 |
导航条上的第一页 |
- |
navigateLastPage |
int32 |
导航条上的最后一页 |
- |
Response-example:
{
"total": 0,
"list": [
{
"id": 0,
"title": "",
"type": 0,
"text": "",
"previewUrl": "",
"sourceUrl": "",
"size": 0,
"userId": 0,
"senderId": 0,
"senderNickname": "",
"senderAlias": "",
"createDate": "yyyy-MM-dd HH:mm:ss"
}
],
"pageNum": 0,
"pageSize": 0,
"size": 0,
"startRow": 0,
"endRow": 0,
"pages": 0,
"prePage": 0,
"nextPage": 0,
"firstPage": true,
"lastPage": true,
"hasPreviousPage": true,
"hasNextPage": true,
"navigatePages": 0,
"navigatepageNums": [
0
],
"navigateFirstPage": 0,
"navigateLastPage": 0
}
10.2. 获取指定收藏信息
Type: GET
Author: Timothy
Content-Type: application/x-www-form-urlencoded
Description: 获取指定收藏信息
Query-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
id |
int32 |
公司ID |
false |
- |
Request-example:
curl -X GET -i '/favorite/queryFavorite?id=0&=54'
Response-fields:
Field | Type | Description | Since |
---|---|---|---|
id |
int32 |
ID |
- |
title |
string |
标题 |
- |
type |
int32 |
类型(对应消息类型) |
- |
text |
string |
文本内容 |
- |
previewUrl |
string |
预览图地址 |
- |
sourceUrl |
string |
原媒体地址 |
- |
size |
int32 |
媒体大小 |
- |
userId |
int32 |
收藏者ID |
- |
senderId |
int32 |
发布者ID |
- |
senderNickname |
string |
发布者昵称 |
- |
senderAlias |
string |
发布者别名 |
- |
createDate |
string |
收藏时间 |
- |
Response-example:
{
"id": 0,
"title": "",
"type": 0,
"text": "",
"previewUrl": "",
"sourceUrl": "",
"size": 0,
"userId": 0,
"senderId": 0,
"senderNickname": "",
"senderAlias": "",
"createDate": "yyyy-MM-dd HH:mm:ss"
}
10.3. 添加信息
URL: /favorite/add
Type: PUT
Author: Timothy
Content-Type: application/json
Description: 添加信息
Body-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
id |
int32 |
ID |
false |
- |
title |
string |
标题 |
false |
- |
type |
int32 |
类型(对应消息类型) |
false |
- |
text |
string |
文本内容 |
false |
- |
previewUrl |
string |
预览图地址 |
false |
- |
sourceUrl |
string |
原媒体地址 |
false |
- |
size |
int32 |
媒体大小 |
false |
- |
userId |
int32 |
收藏者ID |
false |
- |
senderId |
int32 |
发布者ID |
false |
- |
senderNickname |
string |
发布者昵称 |
false |
- |
senderAlias |
string |
发布者别名 |
false |
- |
createDate |
string |
收藏时间 |
false |
- |
Request-example:
curl -X PUT -H "Content-Type: application/json" -i '/favorite/add' --data '{
"id": 0,
"title": "",
"type": 0,
"text": "",
"previewUrl": "",
"sourceUrl": "",
"size": 0,
"userId": 0,
"senderId": 0,
"senderNickname": "",
"senderAlias": "",
"createDate": "yyyy-MM-dd HH:mm:ss"
}'
Response-example:
0
10.4. 修改信息
URL: /favorite/update
Type: PUT
Author: Timothy
Content-Type: application/json
Description: 修改信息
Body-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
id |
int32 |
ID |
false |
- |
title |
string |
标题 |
false |
- |
type |
int32 |
类型(对应消息类型) |
false |
- |
text |
string |
文本内容 |
false |
- |
previewUrl |
string |
预览图地址 |
false |
- |
sourceUrl |
string |
原媒体地址 |
false |
- |
size |
int32 |
媒体大小 |
false |
- |
userId |
int32 |
收藏者ID |
false |
- |
senderId |
int32 |
发布者ID |
false |
- |
senderNickname |
string |
发布者昵称 |
false |
- |
senderAlias |
string |
发布者别名 |
false |
- |
createDate |
string |
收藏时间 |
false |
- |
Request-example:
curl -X PUT -H "Content-Type: application/json" -i '/favorite/update' --data '{
"id": 0,
"title": "",
"type": 0,
"text": "",
"previewUrl": "",
"sourceUrl": "",
"size": 0,
"userId": 0,
"senderId": 0,
"senderNickname": "",
"senderAlias": "",
"createDate": "yyyy-MM-dd HH:mm:ss"
}'
Response-example:
0
10.5. 删除收藏
URL: /favorite/remove
Type: DELETE
Author: Timothy
Content-Type: application/x-www-form-urlencoded
Description: 删除收藏
Query-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
id |
int32 |
No comments found. |
false |
- |
Request-example:
curl -X DELETE -i '/favorite/remove?id=0&=769'
Response-example:
0