简要描述:

添加案例

请求域名:

  • http://xx.com

请求URL:

GET/plugin.case-library.admin.case.case-add(获取视图及数据)
POST/plugin.case-library.admin.case.case-add(添加案例操作)

视图数据返回参数说明:

参数名 类型 说明
allCategory[id] int 分类id
allCategory[pid] int 上级分类id
allCategory[category_name] string 分类名
allCategory[sub_category] array 子分类信息(字段与一级分类一致)
case[id] int 案例id
case[case_name] string 案例名
case[img] string 案例图标(img_src绝对路径)
case[img_mini] string 案例小程序码(img_mini_src绝对路径)
case[img_h5] string 案例二维码(img_h5_src绝对路径)
case[member_id] int 作者id
case[content] string 案例简介
case[is_open] int 是否启用,0否,1是
case[is_recommend] int 首页推荐,0关闭,1开启
case[is_hot] int 热门推荐,0关闭,1开启
case[province_id] int 所在省id
case[city_id] int 所在市id
case[screen_shot] string 案例截图(screen_shot_src绝对路径)
case[category][category_first] int 一级分类id
case[category][category_second] int 二级分类id
case[label][id] int 标签id
case[label][label_name] string 标签名

正确时返回视图数据:

	"allCategory": [
			{
				"id": 1,
				"pid": 0,
				"category_name": "分类1",
				"sub_category": [
					{
						"id": 3,
						"pid": 1,
						"category_name": "子分类1"
					},
					{
						"id": 4,
						"pid": 1,
						"category_name": "子分类2"
					}
				]
			},
			{
				"id": 2,
				"pid": 0,
				"category_name": "分类2",
				"sub_category": [
					{
						"id": 6,
						"pid": 2,
						"category_name": "子分类3"
					}
				]
			},
			{
				"id": 5,
				"pid": 0,
				"category_name": "分类3",
				"sub_category": []
			}
		],
		"case": {
			"id": 9,
			"uniacid": 1,
			"case_name": "案例1",
			"img": "newimage/55812ff61cb4764ce2c995bdd7c37d91.jpg",
			"img_mini": "",
			"img_h5": "",
			"member_id": 164932,
			"content": "简介简介",
			"screen_shot": "",
			"is_open": 0,
			"is_recommend": 0,
			"is_hot": 0,
			"created_at": "2020-12-03 16:12:47",
			"updated_at": "2020-12-03 16:12:47",
			"province_id": 440000,
			"city_id": 440100,
			"screen_shot_src": "",
			"img_src": "http://shop-yunzshop-com.oss-cn-hangzhou.aliyuncs.com/newimage/55812ff61cb4764ce2c995bdd7c37d91.jpg",
			"img_mini_src": "",
			"img_h5_src": "",
			"label": [
				{
					"id": 1,
					"uniacid": 1,
					"label_name": "标签1",
					"created_at": "2020-12-03 16:05:00",
					"updated_at": "2020-12-03 16:05:00",
					"pivot": {
						"case_id": 9,
						"label_id": 1
					}
				},
				{
					"id": 2,
					"uniacid": 1,
					"label_name": "标签2",
					"created_at": "2020-12-03 16:05:12",
					"updated_at": "2020-12-03 16:05:12",
					"pivot": {
						"case_id": 9,
						"label_id": 2
					}
				}
			],
			"category": [
				{
					"id": 3,
					"category_first": 1,
					"category_second": 3,
					"case_id": 9,
					"category_ids": "1,3",
					"created_at": "1970-01-01 08:00:00"
				}
			]
		}

编辑案例传递参数:

参数名 是否必须 类型 说明
id int 案例id
case[case_name] string 案例名
case[img] string 案例图标
case[img_mini] string 案例小程序码
case[img_h5] string 案例二维码
case[member_id] int 作者id
case[content] string 案例简介
case[is_open] int 是否启用,0否,1是
case[is_recommend] int 首页推荐,0关闭,1开启
case[is_hot] int 热门推荐,0关闭,1开启
case[province_id] int 所在省id
case[city_id] int 所在市id
case[screen_shot] string 案例截图
category array 分类组合:[{"category_first":1,"category_second":2},{"category_first":2,"category_second":3}]
label array 标签id数组

返回示例:

正确时返回数据:

{
	"result": 1,
	"msg": "保存成功",
	"data": []
}

错误时返回:

{
	"result": 0,
	"msg": "保存失败",
	"data": []
}

备注:

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