简要描述:

获取案例分类列表视图以及数据

请求域名:

  • http://xx.com

请求URL:

GET/plugin.case-library.admin.case-category.category-list(获取视图)
POST/plugin.case-library.admin.case-category.category-list(获取列表数据)

获取数据传递参数说明:

参数名 是否必须 类型 说明
search[name] string 查询的分类名

返回参数list[data]说明:

参数名 类型 说明
id int 分类id
uniacid int 平台id
pid int 上级分类id
category_name string 分类名
level int 分类等级,1-一级,2-二级
is_hot int 是否热门推荐,0否,1是
show int 是否显示,0-否,1-是
sort int 排序
sub_category array 子分类信息(字段信息一致)

返回示例:

正确时返回的数据:

{
	"result": 1,
	"msg": "ok",
	"data": {
		"list": {
			"total": 3,
			"per_page": 10,
			"current_page": 1,
			"last_page": 1,
			"next_page_url": null,
			"prev_page_url": null,
			"from": 1,
			"to": 3,
			"data": [
				{
					"id": 5,
					"uniacid": 1,
					"pid": 0,
					"category_name": "分类3",
					"level": 1,
					"is_hot": 0,
					"show": 1,
					"sort": 0,
					"created_at": "2020-12-02 16:17:41",
					"updated_at": "2020-12-02 16:17:41",
					"sub_category": []
				},
				{
					"id": 2,
					"uniacid": 1,
					"pid": 0,
					"category_name": "分类2",
					"level": 1,
					"is_hot": 0,
					"show": 1,
					"sort": 0,
					"created_at": "2020-12-02 16:00:07",
					"updated_at": "2020-12-02 16:00:07",
					"sub_category": [
						{
							"id": 6,
							"uniacid": 1,
							"pid": 2,
							"category_name": "子分类3",
							"level": 2,
							"is_hot": 0,
							"show": 1,
							"sort": 0,
							"created_at": "2020-12-02 16:25:22",
							"updated_at": "2020-12-02 16:25:22"
						}
					]
				},
				{
					"id": 1,
					"uniacid": 1,
					"pid": 0,
					"category_name": "分类1",
					"level": 1,
					"is_hot": 0,
					"show": 1,
					"sort": 0,
					"created_at": "2020-12-02 15:59:52",
					"updated_at": "2020-12-02 15:59:52",
					"sub_category": [
						{
							"id": 3,
							"uniacid": 1,
							"pid": 1,
							"category_name": "子分类1",
							"level": 2,
							"is_hot": 0,
							"show": 1,
							"sort": 0,
							"created_at": "2020-12-02 16:16:30",
							"updated_at": "2020-12-02 16:16:30"
						},
						{
							"id": 4,
							"uniacid": 1,
							"pid": 1,
							"category_name": "子分类2",
							"level": 2,
							"is_hot": 0,
							"show": 1,
							"sort": 0,
							"created_at": "2020-12-02 16:16:47",
							"updated_at": "2020-12-02 16:16:47"
						}
					]
				}
			]
		}
	}
}

备注:

  • 更多返回错误代码请看首页的错误代码描述