Commit 322ebe1f77ef5f9d08518b926f533c4313c9c55a

Authored by yangfan
1 parent f2b0f333

菜谱服务数据分离与修改

Showing 1 changed file with 117 additions and 36 deletions
... ... @@ -2,17 +2,45 @@
name: "菜谱服务"
request:
base_url: http://dc1.colorcun.com:10005?s=
variable_binds:
- menu_name: "新年菜谱"
- sellerid: "9"
- menu_status_on: "1"
- menu_status_off: "0"
- menu_type_in: "1"
- menu_type_out: "2"
- menu_image: "/Users/orange/cover.jpeg"
- menu_id: "5"
- menu_id_no: "6"
- sellerid_no: "10000"
#添加菜谱
- test:
name: 添加菜谱(正确操作)
name: 添加菜谱(正确操作-堂食-启用)
variable_binds:
- name: "菜谱测试1"
- sellerid: "15"
- status: "1"
- type: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,image=$image)}
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_on
- type: $menu_type_in
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜谱(正确操作-外卖-启用)
variable_binds:
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_on
- type: $menu_type_out
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -22,13 +50,48 @@
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜谱(正确操作-外卖-停用)
variable_binds:
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_off
- type: $menu_type_out
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜谱(正确操作-堂食-停用)
variable_binds:
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_off
- type: $menu_type_in
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜谱(不填name)
variable_binds:
- sellerid: "15"
- status: "1"
- type: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data(sellerid=$sellerid,status=$status,image=$image)}
- sellerid: $sellerid
- status: $menu_status_on
- type: $menu_type_in
- image: $menu_image
- multipart_encoder: ${get_data(sellerid=$sellerid,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -41,11 +104,11 @@
- test:
name: 添加菜谱(不填sellerid)
variable_binds:
- name: "菜谱测试1"
- status: "1"
- type: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data(name=$name,status=$status,image=$image)}
- name: $menu_name
- status: $menu_status_off
- type: $menu_type_in
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,status=$status,type=$type,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -58,11 +121,28 @@
- test:
name: 添加菜谱(不填status)
variable_binds:
- name: "菜谱测试1"
- sellerid: "15"
- type: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,image=$image)}
- name: $menu_name
- sellerid: $sellerid
- type: $menu_type_in
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,image=$image,type=$type)}
request:
url: App.Menu.AddMenu
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数status"]
- test:
name: 添加菜谱(不填type)
variable_binds:
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_off
- image: $menu_image
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,image=$image,status=$status)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -75,11 +155,11 @@
- test:
name: 添加菜谱(不填image)
variable_binds:
- name: "菜谱测试1"
- sellerid: "15"
- status: "1"
- type: "1"
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status)}
- name: $menu_name
- sellerid: $sellerid
- status: $menu_status_off
- type: $menu_type_in
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,type=$type)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -90,6 +170,7 @@
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少上传文件:image"]
#根据菜谱ID获取关联菜品
- test:
name: 根据菜谱ID获取关联菜品(正确操作)
... ... @@ -97,7 +178,7 @@
url: App.Menu.GetCookBookByMenuId
method: POST
data:
id: 1
id: $menu_id
validate:
- eq: ["content.ret", 200]
# 预留校验
... ... @@ -107,7 +188,7 @@
url: App.Menu.GetCookBookByMenuId
method: POST
data:
id: 1
id: $menu_id_no
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无关联菜品"]
... ... @@ -120,7 +201,7 @@
url: App.Menu.GetCookBookNumByMenuId
method: POST
data:
id: 1
id: $menu_id
validate:
- eq: ["content.ret", 200]
- test:
... ... @@ -129,7 +210,7 @@
url: App.Menu.GetCookBookNumByMenuId
method: POST
data:
id: 10000
id: $menu_id_no
validate:
- eq: ["content.ret", 200]
... ... @@ -140,17 +221,17 @@
url: App.Menu.GetMenuById
method: POST
data:
id: 1
id: $menu_id
validate:
- eq: ["content.ret", 200]
- eq: ["content.data[0].id", "1"]
- eq: ["content.data[0].id", $menu_id]
- test:
name: 根据菜谱ID获取菜谱基本信息(暂无菜谱)
request:
url: App.Menu.GetMenuById
method: POST
data:
id: 1000
id: $menu_id_no
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无菜谱"]
... ... @@ -162,7 +243,7 @@
url: App.Menu.GetMenuLists
method: POST
data:
sellerid: 1
sellerid: $sellerid
validate:
- eq: ["content.ret", 200]
- test:
... ... @@ -171,7 +252,7 @@
url: App.Menu.GetMenuLists
method: POST
data:
sellerid: 1
sellerid: $sellerid_no
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无菜谱"]
... ...