该接口用于查询指定类型的资源,例如管理端将资源设置为热门资源,或者是推荐资源。在某些业务场景下,只需要查询出该类型的资源,可以通过该接口获取。
查询接口
目前只支持热门资源和推荐资源两种类型。
请求方法:GET
是否鉴权:否
请求编码:Content-Type:application/x-www-form-urlencoded
响应编码:Content-Type:application/json;charset=UTF-8
请求地址:index/resource.resource/homeResource
请求参数:
参数名 | 参数类型 | 是否必填 | 参数说明 | 示例值 |
---|---|---|---|---|
scene | String | 是 | 查询类型(recommend:推荐资源,hot:热门资源) | |
page | int | 是 | 页码 | 1 |
size | int | 是 | 每页条数 | 20 |
- 成功示例:
javascript
{
"data": {
"items": [
{
"title": "Java面试真题100道",
"category_uid": "661d08d18772a",
"download": 10,
"publish_date": "2024-04-16",
"author": "兔兔答题",
"uid": "661e15d63b18d",
"cover": "https://qiniucloud.qqdeveloper.com/uploads/images/20240416/20240416141206de2152408.png",
"category": {
"title": "Java编程",
"uid": "661d08d18772a"
},
"year": "2024",
"collect_count": 20,
"like_count": 10
}
],
"total": 4,
"page": 1,
"size": 20
},
"code": 100,
"msg": "查询成功"
}
参数名 | 参数类型 | 是否必有 | 参数说明 | 示例值 |
---|---|---|---|---|
title | String | 是 | 资源名称 | |
category_uid | String | 是 | 资源分类id | |
download | int | 是 | 下载量 | |
publish_date | String | 是 | 发布时间 | |
author | String | 是 | 作者 | |
uid | String | 是 | 资源id | |
cover | String | 是 | 封面 | |
category.title | String | 是 | 分类名称 | |
category.uid | String | 是 | 分类id | |
year | String | 是 | 年份 | |
collect_count | int | 是 | 收藏量 | |
like_count | int | 是 | 点赞量 | |
data.total | int | 是 | 总条数 | |
data.page | int | 是 | 当前页码 | |
data.size | int | 是 | 每页条数 |
- 失败示例:
javascript
{
"code": 101,
"data": [],
"msg": "请求失败"
}