Skip to content

后台商品分类管理

sfyr111 edited this page Feb 26, 2018 · 1 revision

POST 添加产品分类

{{host}}/manage/category/addCategory

request

params

name
parentId: 0 为 root 节点

response

success

{
    "status": 0,
    "msg": "添加品类成功",
    "data": {
        "status": 1,
        "createTime": "2018-02-26T08:23:03.449Z",
        "updateTime": "2018-02-26T08:23:03.449Z",
        "id": 8,
        "name": "4子类别3",
        "parentId": "4"
    }
}

error

{
    "status": 20,
    "msg": "用户不是管理员无权操作",
    "data": null
}

PUT 更新分类名称

{{host}}/manage/category/updateCategoryName

request

params

id
name

response

success

{
    "status": 0,
    "msg": "更新品类名称成功",
    "data": {
        "id": 1,
        "parentId": 0,
        "name": "分类gai1",
        "status": 1,
        "sortOrder": null,
        "createTime": "2018-02-13T17:31:32.000Z",
        "updateTime": "2018-02-26T08:49:38.011Z"
    }
}

error

{
    "status": 20,
    "msg": "用户不是管理员无权操作",
    "data": null
}

GET 获取某分类下评级的子分类

{{host}}/manage/category/parentId/:parentId

response

success

{
    "status": 0,
    "msg": null,
    "data": [
        {
            "id": 4,
            "parentId": 1,
            "name": "1子类别1",
            "status": 1
        },
        {
            "id": 5,
            "parentId": 1,
            "name": "1子类别2",
            "status": 1
        }
    ]
}

GET 深度查询某分类id 及其子分类id

{{host}}/manage/category/deep/parentId/:parentId

response

{
    "status": 0,
    "msg": null,
    "data": [
        1,
        4,
        6,
        7,
        8,
        5
    ]
}