后台_分类接口 - SilentJhin/mmall GitHub Wiki

1.获取品类子节点(平级)

http://localhost:8080/manage/category/get_category.do http://localhost:8080/manage/category/get_category.do?categoryId=0 http://localhost:8080/manage/category/get_category.do?categoryId=2 /manage/category/get_category.do

request

categoryId(default=0)

response success

{
    "status": 0,
    "data": [
        {
            "id": 100001,
            "parentId": 0,
            "name": "家用电器",
            "status": true,
            "sortOrder": null,
            "createTime": 1490431560000,
            "updateTime": 1490431560000
        },
        {
            "id": 100002,
            "parentId": 0,
            "name": "数码3C",
            "status": true,
            "sortOrder": null,
            "createTime": 1490431581000,
            "updateTime": 1490431581000
        },
        {
            "id": 100003,
            "parentId": 0,
            "name": "服装箱包",
            "status": true,
            "sortOrder": null,
            "createTime": 1490431793000,
            "updateTime": 1490431793000
        },
        {
            "id": 100004,
            "parentId": 0,
            "name": "食品生鲜",
            "status": true,
            "sortOrder": null,
            "createTime": 1490431819000,
            "updateTime": 1490431819000
        },
        {
            "id": 100005,
            "parentId": 0,
            "name": "酒水饮料",
            "status": true,
            "sortOrder": null,
            "createTime": 1490431829000,
            "updateTime": 1490431829000
        }
    ]
}

http://localhost:8080/manage/category/get_category.do?categoryId=19 fail

{
    "status": 10,
    "msg": "用户未登录,请登录"
}
或
{
    "status": 1,
    "msg": "未找到该品类"
}

2.增加节点

/manage/category/add_category.do

request

parentId(default=0)
categoryName

response success

{
    "status": 0,
    "msg": "添加品类成功"
}

fail

{
    "status":1,
    "msg": "添加品类失败"
}

3.修改品类名字

http://localhost:8080/manage/category/set_category_name.do?categoryId=999&categoryName=%E5%98%BB%E5%98%BB /manage/category/set_category_name.do

request

categoryId
categoryName

response success

{
    "status": 0,
    "msg": "更新品类名字成功"
}

fail

{
    "status": 1,
    "msg": "更新品类名字失败"
}

4.获取当前分类id及递归子节点categoryId

http://localhost:8080/manage/category/get_deep_category.do?categoryId=100001 /manage/category/get_deep_category.do

request

categoryId

response success

{
    "status": 0,
    "data": [
        100008,
        100010,
        100001,
        100006,
        100009,
        100007
    ]
}

fail

{
    "status": 1,
    "msg": "无权限操作,需要管理员权限"
}