Skip to content

点赞

获取点赞列表

GET /resource_likes

权限

  • 需要认证

请求参数

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

响应

json
{
    "data": [
        {
            "id": "1",
            "targetId": "3",
            "targetType": "knowledge",
            "userId": "272",
            "createdTime": "2020-12-07T21:56:38+08:00"
        },
        {
            "id": "5",
            "targetId": "39",
            "targetType": "knowledge",
            "userId": "272",
            "createdTime": "2020-12-07T22:20:46+08:00"
        },
        {
            "id": "6",
            "targetId": "38",
            "targetType": "knowledge",
            "userId": "272",
            "createdTime": "2020-12-07T22:23:08+08:00"
        },
        {
            "id": "7",
            "targetId": "56",
            "targetType": "knowledge",
            "userId": "1228",
            "createdTime": "2020-12-07T23:13:03+08:00"
        },
        {
            "id": "8",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "0",
            "createdTime": "2020-12-07T23:36:04+08:00"
        },
        {
            "id": "9",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "0",
            "createdTime": "2020-12-07T23:37:13+08:00"
        },
        {
            "id": "10",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "0",
            "createdTime": "2020-12-07T23:37:25+08:00"
        },
        {
            "id": "11",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "0",
            "createdTime": "2020-12-07T23:37:33+08:00"
        },
        {
            "id": "12",
            "targetId": "75",
            "targetType": "knowledge",
            "userId": "1232",
            "createdTime": "2020-12-08T15:39:53+08:00"
        },
        {
            "id": "13",
            "targetId": "61",
            "targetType": "knowledge",
            "userId": "0",
            "createdTime": "2020-12-09T10:51:34+08:00"
        }
    ],
    "paging": {
        "total": 30,
        "offset": 0,
        "limit": 10
    }
}

字段说明

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

点赞资源

POST /resource_like

权限

  • 需要认证

请求参数Body请求参数

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

GET 获取点赞

GET /resource_like/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

json
{
    "id": "1",
    "targetId": "3",
    "targetType": "knowledge",
    "userId": "272",
    "createdTime": "2020-12-07T21:56:38+08:00"
}

参数说明

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

取消收藏

DELETE /resource_like/{id}

权限

  • 需要认证

请求参数

名称位置类型必选说明
idpathstringtruenone

响应

json
{
    "success": true
}