Skip to content

收藏

获取收藏列表

GET /resource_favorite

权限

  • 需要认证

请求参数

名称位置类型必选说明
targetIdquerystringfalse收藏资源的id
targetTypequerystringfalse收藏资源的类型
sortquerystringfalse排序字段
offsetquerystringfalse分页偏移值, 默认0
limitquerystringfalse每一页数量, 默认10

响应

json
{
    "data": [
        {
            "id": "1",
            "targetId": "9",
            "targetType": "offlineCourseTemplate",
            "userId": "1207",
            "createdTime": "2020-06-30T15:40:29+08:00"
        },
        {
            "id": "3",
            "targetId": "23",
            "targetType": "offlineCourseTemplate",
            "userId": "1106",
            "createdTime": "2020-07-30T20:29:22+08:00"
        },
        {
            "id": "4",
            "targetId": "15",
            "targetType": "offlineCourseTemplate",
            "userId": "1106",
            "createdTime": "2020-07-30T20:29:40+08:00"
        },
        {
            "id": "5",
            "targetId": "3",
            "targetType": "knowledge",
            "userId": "272",
            "createdTime": "2020-12-07T21:56:39+08:00"
        },
        {
            "id": "12",
            "targetId": "56",
            "targetType": "knowledge",
            "userId": "1228",
            "createdTime": "2020-12-07T23:13:04+08:00"
        },
        {
            "id": "13",
            "targetId": "48",
            "targetType": "knowledge",
            "userId": "1228",
            "createdTime": "2020-12-07T23:13:33+08:00"
        },
        {
            "id": "14",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "1228",
            "createdTime": "2020-12-07T23:19:06+08:00"
        },
        {
            "id": "16",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "1051",
            "createdTime": "2020-12-07T23:48:51+08:00"
        },
        {
            "id": "17",
            "targetId": "39",
            "targetType": "knowledge",
            "userId": "272",
            "createdTime": "2020-12-07T23:48:59+08:00"
        },
        {
            "id": "18",
            "targetId": "51",
            "targetType": "knowledge",
            "userId": "1051",
            "createdTime": "2020-12-07T23:49:06+08:00"
        }
    ],
    "paging": {
        "total": 35,
        "offset": 0,
        "limit": 10
    }
}

字段说明

名称类型必选约束说明
» idinteger(int64)falsenonenone
» targetIdinteger(int64)falsenonenone
» targetTypestringfalsenonenone
» userIdinteger(int64)falsenonenone
» createdTimeinteger(int64)falsenonenone

收藏资源

POST /resource_favorite

权限

  • 需要认证

请求参数Body请求参数

json
{
    "targetId": 1,
    "targetType": "knowledge"
}

GET 获取收藏

GET /resource_favorite/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

json
{
    "id": "1",
    "targetId": "9",
    "targetType": "offlineCourseTemplate",
    "userId": "1207",
    "createdTime": "2020-06-30T15:40:29+08:00"
}

参数说明

名称类型必选约束说明
» idinteger(int64)falsenonenone
» targetIdinteger(int64)falsenonenone
» targetTypestringfalsenonenone
» userIdinteger(int64)falsenonenone
» createdTimeinteger(int64)falsenonenone

取消收藏

DELETE /resource_favorite/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

json
{
    "success": true
}