Commit a1731c25de2e85d91454af6160c8b1b6011327da

Authored by yangfan
1 parent 79a72b62

菜品服务和桌位服务singleAPI,处理get_data

import sys
reload(sys)
sys.setdefaultencoding('utf8')
import mysql.connector
conn = mysql.connector.connect(
user = 'root',
password = 'LeCunKe20170215',
host = '123.56.79.57',
database = 'xt-dc'
)
cur = conn.cursor()
query = ("SELECT id,name FROM xt_seller")
cur.execute(query)
for (id, name) in cur:
print("{}, {}".format(id, name))
cur.close()
conn.close()
... ...
from requests_toolbelt import MultipartEncoder
import requests
import sys
import json
reload(sys)
sys.setdefaultencoding('utf8')
def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
def get_data(name, phone, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -14,7 +19,9 @@ def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
}
)
return m
def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath):
def get_data_noname(phone, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'phone': phone,
... ... @@ -26,7 +33,9 @@ def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath):
}
)
return m
def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath):
def get_data_nophone(name, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -38,7 +47,9 @@ def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath):
}
)
return m
def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath):
def get_data_nomapaddress(name, phone, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -50,7 +61,9 @@ def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath):
}
)
return m
def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath):
def get_data_nofile(name, phone, map_address, longPoint, latPoint, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -62,7 +75,9 @@ def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath):
}
)
return m
def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath):
def get_data_noimage(name, phone, map_address, longPoint, latPoint, filePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -74,7 +89,9 @@ def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath):
}
)
return m
def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath):
def get_data_nolong(name, phone, map_address, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -86,7 +103,9 @@ def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath):
}
)
return m
def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath):
def get_data_nolat(name, phone, map_address, longPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -98,10 +117,13 @@ def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath):
}
)
return m
def get_content_type(data):
return data.content_type
def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePath):
def set_data(sellerid, name, phone, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -115,7 +137,9 @@ def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePa
}
)
return m
def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
def set_data_noid(name, phone, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -128,7 +152,9 @@ def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
}
)
return m
def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,imagePath):
def set_data_noname(sellerid, phone, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -141,7 +167,9 @@ def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,image
}
)
return m
def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,imagePath):
def set_data_nophone(sellerid, name, map_address, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -154,7 +182,9 @@ def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,image
}
)
return m
def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imagePath):
def set_data_nomapaddress(sellerid, name, phone, longPoint, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -167,7 +197,9 @@ def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imageP
}
)
return m
def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath):
def set_data_nolong(sellerid, name, phone, map_address, latPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -180,7 +212,9 @@ def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath)
}
)
return m
def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath):
def set_data_nolat(sellerid, name, phone, map_address, longPoint, filePath, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -193,7 +227,9 @@ def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath)
}
)
return m
def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath):
def set_data_nofile(sellerid, name, phone, map_address, longPoint, latPoint, imagePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -206,7 +242,9 @@ def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath
}
)
return m
def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath):
def set_data_noimage(sellerid, name, phone, map_address, longPoint, latPoint, filePath):
m = MultipartEncoder(
fields={
'id': sellerid,
... ... @@ -219,7 +257,9 @@ def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath
}
)
return m
def get_menu(name,sellerid,status,imagePath):
def get_menu(name, sellerid, status, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -229,7 +269,9 @@ def get_menu(name,sellerid,status,imagePath):
}
)
return m
def get_menu_noname(sellerid,status,imagePath):
def get_menu_noname(sellerid, status, imagePath):
m = MultipartEncoder(
fields={
'sellerid': sellerid,
... ... @@ -238,7 +280,9 @@ def get_menu_noname(sellerid,status,imagePath):
}
)
return m
def get_menu_noid(name,status,imagePath):
def get_menu_noid(name, status, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -247,7 +291,9 @@ def get_menu_noid(name,status,imagePath):
}
)
return m
def get_menu_nostatus(name,sellerid,imagePath):
def get_menu_nostatus(name, sellerid, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -256,7 +302,9 @@ def get_menu_nostatus(name,sellerid,imagePath):
}
)
return m
def get_menu_noimage(name,sellerid,status):
def get_menu_noimage(name, sellerid, status):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -265,7 +313,9 @@ def get_menu_noimage(name,sellerid,status):
}
)
return m
def set_menu(menuid,name,status,imagePath):
def set_menu(menuid, name, status, imagePath):
m = MultipartEncoder(
fields={
'id': menuid,
... ... @@ -275,7 +325,9 @@ def set_menu(menuid,name,status,imagePath):
}
)
return m
def set_menu_noid(name,status,imagePath):
def set_menu_noid(name, status, imagePath):
m = MultipartEncoder(
fields={
'name': name,
... ... @@ -284,7 +336,9 @@ def set_menu_noid(name,status,imagePath):
}
)
return m
def set_menu_noname(menuid,status,imagePath):
def set_menu_noname(menuid, status, imagePath):
m = MultipartEncoder(
fields={
'id': menuid,
... ... @@ -293,7 +347,9 @@ def set_menu_noname(menuid,status,imagePath):
}
)
return m
def set_menu_nostatus(menuid,name,imagePath):
def set_menu_nostatus(menuid, name, imagePath):
m = MultipartEncoder(
fields={
'id': menuid,
... ... @@ -302,7 +358,9 @@ def set_menu_nostatus(menuid,name,imagePath):
}
)
return m
def set_menu_noimage(menuid,name,status):
def set_menu_noimage(menuid, name, status):
m = MultipartEncoder(
fields={
'id': menuid,
... ... @@ -310,4 +368,26 @@ def set_menu_noimage(menuid,name,status):
'status': status
}
)
return m
\ No newline at end of file
return m
def get_cook(**args):
fields = {}
for key in args:
if key == "image":
fields[key] = ("image", open(bytes(args[key]), "rb"), "image/jpeg")
else:
fields[key] = bytes(args[key])
m = MultipartEncoder(fields)
return m
def get_data(**args):
fields = {}
for key in args:
if key == "image" or key == "file":
fields[key] = ("image", open(bytes(args[key]), "rb"), "image/jpeg")
else:
fields[key] = bytes(args[key])
m = MultipartEncoder(fields)
return m
... ...
... ... @@ -3,6 +3,7 @@
request:
base_url: http://dc1.colorcun.com:10005?s=
#添加商家信息
- test:
name: 添加商家信息(正确操作)
variable_binds:
... ... @@ -13,7 +14,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -32,7 +33,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_noname($phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -52,7 +53,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_nophone($name,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -72,7 +73,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_nomapaddress($name,$phone,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -91,7 +92,7 @@
- long: "123"
- lat: "456"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_nofile($name,$phone,$map_address,$long,$lat,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -110,7 +111,7 @@
- long: "123"
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_noimage($name,$phone,$map_address,$long,$lat,$file)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -129,7 +130,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_nolong($name,$phone,$map_address,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -148,7 +149,7 @@
- long: "123"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data_nolat($name,$phone,$map_address,$long,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -168,7 +169,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -188,7 +189,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -199,9 +200,7 @@
- eq: ["content.ret", 398]
- eq: ["content.msg","非法请求:手机号已存在"]
#获取商家列表数据
- test:
name: 获取商家列表数据(查询第一页)
request:
... ... @@ -222,7 +221,7 @@
- eq: ["content.ret", 396]
- eq: ["content.msg","非法请求:暂无商家"]
#根据商家ID获取商家信息
- test:
name: 根据商家ID获取商家信息(sellerid=5)
request:
... ... @@ -244,8 +243,7 @@
- eq: ["content.ret", 396]
- eq: ["content.msg","非法请求:暂无商家"]
#根据商家ID修改商家信息
- test:
name: 根据商家ID修改商家信息(正确操作)
variable_binds:
... ... @@ -257,7 +255,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -276,7 +274,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_noid($name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -296,7 +294,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_noname($id,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -316,7 +314,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_nophone($id,$name,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -336,7 +334,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_nomapaddress($id,$name,$phone,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -356,7 +354,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_nolong($id,$name,$phone,$map_address,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -376,7 +374,7 @@
- long: "123"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_nolat($id,$name,$phone,$map_address,$long,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -396,7 +394,7 @@
- long: "123"
- lat: "456"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_nofile($id,$name,$phone,$map_address,$long,$lat,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -416,7 +414,7 @@
- long: "123"
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data_noimage($id,$name,$phone,$map_address,$long,$lat,$file)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file)}
request:
url: App.Seller.SetSellerById
method: POST
... ... @@ -437,7 +435,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -458,7 +456,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.AddSeller
method: POST
... ... @@ -479,7 +477,7 @@
- lat: "456"
- file: "/Users/orange/cover.jpeg"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
request:
url: App.Seller.SetSellerById
method: POST
... ...
- config:
name: "桌位服务"
request:
base_url: http://dc1.colorcun.com:10005?s=
- test:
name: 添加商家桌位区域(正确操作)
request:
url: App.Tables.AddTableRegion
method: POST
data:
sellerid: 9
name: "包间"
validate:
- eq: ["content.ret", 200]
- test:
name: 添加商家桌位区域(不填sellerid)
request:
url: App.Tables.AddTableRegion
method: POST
data:
name: "包间"
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
- test:
name: 添加商家桌位区域(不填name)
request:
url: App.Tables.AddTableRegion
method: POST
data:
sellerid: 9
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数name"]
- test:
name: 修改商家桌位区域(修改name)
request:
url: App.Tables.AddTable
method: POST
data:
id: 4
sellerid: 9
name: "区域修改"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改商家桌位区域(修改name和order)
request:
url: App.Tables.AddTable
method: POST
data:
id: 4
sellerid: 9
name: "区域修改"
order: 10
validate:
- eq: ["content.ret", 200]
- test:
name: 修改商家桌位区域(修改order)
request:
url: App.Tables.AddTable
method: POST
data:
id: 4
sellerid: 9
order: 2
validate:
- eq: ["content.ret", 200]
- test:
name: 修改商家桌位区域(修改失败-不存在的区域)
request:
url: App.Tables.AddTable
method: POST
data:
id: 10000
sellerid: 9
name: "区域修改"
order: 10
validate:
- eq: ["content.ret", 398]
- eq: ["content.ret", "非法请求:修改区域失败"]
- test:
name: 获取单条区域信息(正确操作)
request:
url: App.Tables.GetRegionById
method: POST
data:
id: 1
validate:
- eq: ["content.ret", 200]
- test:
name: 获取单条区域信息(暂无数据)
request:
url: App.Tables.GetRegionById
method: POST
data:
id: 200
validate:
- eq: ["content.ret", 400]
- eq: ["content.ret", "非法请求:暂无数据"]
- test:
name: 获取商家桌位列表数据(正确操作)
request:
url: App.Tables.GetTableListsBySellerId
method: POST
data:
sellerid: 4
page: 1
validate:
- eq: ["content.ret", 200]
- test:
name: 获取商家桌位列表数据(page过大)
request:
url: App.Tables.GetTableListsBySellerId
method: POST
data:
sellerid: 4
page: 100
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无数据"]
- test:
name: 获取商家桌位列表数据(不填sellerid)
request:
url: App.Tables.GetTableListsBySellerId
method: POST
data:
page: 1
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
- test:
name: 获取商家桌位列表数据(不填page)
request:
url: App.Tables.GetTableListsBySellerId
method: POST
data:
sellerid: 4
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数page"]
- test:
name: 添加商家桌位信息(正确操作)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
name: "杏花阁"
table_no: "001"
table_pnum: 10
validate:
- eq: ["content.ret", 200]
- test:
name: 添加商家桌位信息(不填rid)
request:
url: App.Tables.AddTable
method: POST
data:
sellerid: 9
name: "杏花阁"
table_no: "001"
table_pnum: 10
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数rid"]
- test:
name: 添加商家桌位信息(不填sellerid)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
name: "杏花阁"
table_no: "001"
table_pnum: 10
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
- test:
name: 添加商家桌位信息(不填name)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
table_no: "001"
table_pnum: 10
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数name"]
- test:
name: 添加商家桌位信息(不填table_no)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
name: "杏花阁"
table_pnum: 10
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数table_no"]
- test:
name: 添加商家桌位信息(不填table_pnum)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
name: "杏花阁"
table_no: "001"
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数table_pnum"]
- test:
name: 添加商家桌位信息(name超过30)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
name: "杏花阁杏花阁杏花阁杏花阁"
table_no: "001"
table_pnum: 10
validate:
- eq: ["content.ret", 400]
- test:
name: 添加商家桌位信息(table_pnum超过99)
request:
url: App.Tables.AddTable
method: POST
data:
rid: 4
sellerid: 9
name: "杏花阁"
table_no: "001"
table_pnum: 100
validate:
- eq: ["content.ret", 400]
- test:
name: 修改桌位信息(修改全部)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
rid: 10
name: "杏花阁修改"
order: 99
table_no: "010"
table_pnum: 90
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(不填id)
request:
url: App.Tables.SetTableById
method: POST
data:
rid: 10
name: "杏花阁修改"
order: 99
table_no: "010"
table_pnum: 90
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数id"]
- test:
name: 修改桌位信息(修改rid)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
rid: 99
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(修改name)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
name: "杏花阁修改1"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(修改order)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
order: 55
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(修改table_no)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
table_no: "099"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(修改table_pnum)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 5
table_pnum: 55
validate:
- eq: ["content.ret", 200]
- test:
name: 修改桌位信息(修改失败-不存在的桌台)
request:
url: App.Tables.SetTableById
method: POST
data:
id: 500
rid: 10
name: "杏花阁修改"
order: 99
table_no: "010"
table_pnum: 90
validate:
- eq: ["content.ret", 396]
- eq: ["content.msg", "非法请求:修改桌台失败"]
\ No newline at end of file
... ...
- config:
name: "菜品服务"
request:
base_url: http://dc1.colorcun.com:10005?s=
#添加菜品分类
- test:
name: 添加菜品分类(正确操作)
request:
url: App.Cookbook.AddCookbookClass
method: POST
data:
sellerid: 1
class_name: "热菜"
class_type: "菜品分类"
order: 1
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜品分类(不填sellerid)
request:
url: App.Cookbook.AddCookbookClass
method: POST
data:
class_name: "热菜"
class_type: "菜品分类"
order: 1
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
- test:
name: 添加菜品分类(不填class_name)
request:
url: App.Cookbook.AddCookbookClass
method: POST
data:
sellerid: 1
class_type: "菜品分类"
order: 1
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数class_name"]
- test:
name: 添加菜品分类(不填class_type)
request:
url: App.Cookbook.AddCookbookClass
method: POST
data:
sellerid: 1
class_name: "热菜"
order: 1
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数class_type"]
- test:
name: 添加菜品分类(不填order)
request:
url: App.Cookbook.AddCookbookClass
method: POST
data:
sellerid: 1
class_name: "热菜"
class_type: "菜品分类"
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数order"]
#修改菜品分类
- test:
name: 修改菜品分类(全部修改)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_name: "热菜修改"
class_type: "菜品分类修改"
order: 2
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(只修改class_name)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_name: "热菜修改"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(只修改class_type)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_type: "菜品分类修改"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(只修改order)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
order: 2
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(修改class_name和class_type)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_name: "热菜修改"
class_type: "菜品分类修改"
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(修改class_name和order)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_name: "热菜修改"
order: 2
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(修改class_type和order)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
id: 2
class_type: "菜品分类修改"
order: 2
validate:
- eq: ["content.ret", 200]
- test:
name: 修改菜品分类(不传id)
request:
url: App.Cookbook.SetCookbookClassById
method: POST
data:
class_name: "热菜修改"
class_type: "菜品分类"
order: 2
validate:
- eq: ["content.ret", 400]
- eq: ["content.ret", "非法请求:缺少必要参数id"]
#删除菜品分类
- test:
name: 删除菜品分类(删除成功)
request:
url: App.Cookbook.DelCookbookClassById
method: POST
data:
id: 2
validate:
- eq: ["content.ret", 200]
# - test:
# name: 删除菜品分类(当前分类下有菜品)
# request:
# url: App.Cookbook.DelCookbookClassById
# method: POST
# data:
# id: 3
# validate:
# - eq: ["content.ret", 200]
#获取菜品分类
- test:
name: 获取菜品分类(正确操作)
request:
url: App.Cookbook.GetCookbookClassBySellerId
method: POST
data:
Sellerid: 1
validate:
- eq: ["content.ret", 200]
- test:
name: 获取菜品分类(不填Sellerid)
request:
url: App.Cookbook.GetCookbookClassBySellerId
method: POST
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数SellerId"]
- test:
name: 获取菜品分类(暂无分类)
request:
url: App.Cookbook.GetCookbookClassBySellerId
method: POST
data:
Sellerid: 1
validate:
- eq: ["content.ret", 396]
- eq: ["content.msg", "非法请求:暂无分类"]
#获取分类下所有菜品
- test:
name: 获取分类下所有菜品(正确操作)
request:
url: App.Cookbook.GetCookbookByClassId
method: POST
data:
ClassId: 1
validate:
- eq: ["content.ret", 200]
- test:
name: 获取分类下所有菜品(不填ClassId)
request:
url: App.Cookbook.GetCookbookByClassId
method: POST
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数ClassId"]
- test:
name: 获取分类下所有菜品(暂无菜品)
request:
url: App.Cookbook.GetCookbookByClassId
method: POST
data:
ClassId: 100
validate:
- eq: ["content.ret", 397]
- eq: ["content.msg", "非法请求:暂无菜品"]
#添加菜品信息
- test:
name: 添加菜品信息(正确操作)
variable_binds:
- sellerid: "100"
- mid: "100"
- cid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,cid=$cid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 200]
- test:
name: 添加菜品信息(不填写sellerid)
variable_binds:
- mid: "100"
- cid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(mid=$mid,cid=$cid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
- test:
name: 添加菜品信息(不填mid)
variable_binds:
- sellerid: "100"
- cid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,cid=$cid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数mid"]
- test:
name: 添加菜品信息(不填cid)
variable_binds:
- sellerid: "100"
- mid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数cid"]
- test:
name: 添加菜品信息(不填unit)
variable_binds:
- sellerid: "100"
- mid: "100"
- cid: "100"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,cid=$cid,name=$name,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数unit"]
- test:
name: 添加菜品信息(不填name)
variable_binds:
- sellerid: "100"
- mid: "100"
- cid: "100"
- unit: "份"
- first_name: "测试"
- search_code: "test"
- status: "1"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,cid=$cid,unit=$unit,first_name=$first_name,search_code=$search_code,status=$status,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数name"]
- test:
name: 添加菜品信息(不填status)
variable_binds:
- sellerid: "100"
- mid: "100"
- cid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,cid=$cid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,dishSkuList=$dishSkuList,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数status"]
- test:
name: 添加菜品信息(不填dishSkuList)
variable_binds:
- sellerid: "100"
- mid: "100"
- cid: "100"
- unit: "份"
- name: "测试菜谱"
- first_name: "测试"
- search_code: "test"
- status: "1"
- spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
- printid: "1"
- setup: "1"
- give: "1"
- image: "/Users/orange/cover.jpeg"
- desc: "miaoshu"
- multipart_encoder: ${get_data(sellerid=$sellerid,mid=$mid,cid=$cid,unit=$unit,name=$name,first_name=$first_name,search_code=$search_code,status=$status,spuAttrList=$spuAttrList,printid=$printid,setup=$setup,give=$give,image=$image,desc=$desc)}
request:
url: App.Cookbook.AddCookbook
method: POST
headers:
Content-Type: ${get_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少必要参数dishSkuList"]
#删除菜品
- test:
name: 删除菜品(删除成功)
request:
url: App.Cookbook.DelCookbookById
method: POST
data:
id: 19
validate:
- eq: ["content.ret", 200]
- test:
name: 删除菜品(不存在的菜品)
request:
url: App.Cookbook.DelCookbookById
method: POST
data:
id: 300
validate:
- eq: ["content.ret", 394]
- eq: ["content.msg", "非法请求:删除菜品失败"]
#修改单个菜品排序
- test:
name: 修改单个菜品排序(正确操作)
request:
url: App.Cookbook.SetCookbookOrderById
method: POST
data:
id: 19
order: 10
validate:
- eq: ["content.ret", 200]
- test:
name: 修改单个菜品排序(相同排序)
request:
url: App.Cookbook.SetCookbookOrderById
method: POST
data:
id: 19
order: 10
validate:
- eq: ["content.ret", 398]
- eq: ["content.msg", "非法请求:修改失败"]
- test:
name: 修改单个菜品排序(无效菜品)
request:
url: App.Cookbook.SetCookbookOrderById
method: POST
data:
id: 100
order: 10
validate:
- eq: ["content.ret", 398]
- eq: ["content.msg", "非法请求:修改失败"]
#获取商家下所有菜品
- test:
name: 获取商家下所有菜品(按SellerId搜索)
request:
url: App.Cookbook.GetCookbookBySellerId
method: POST
data:
page: 1
SellerId: 4
validate:
- eq: ["content.ret", 200]
- test:
name: 获取商家下所有菜品(添加CookbookName)
request:
url: App.Cookbook.GetCookbookBySellerId
method: POST
data:
page: 1
SellerId: 4
CookbookName: "黑醋蛰头"
validate:
- eq: ["content.ret", 200]
- test:
name: 获取商家下所有菜品(添加ClassId)
request:
url: App.Cookbook.GetCookbookBySellerId
method: POST
data:
page: 1
SellerId: 4
ClassId: 7
validate:
- eq: ["content.ret", 200]
- test:
name: 获取商家下所有菜品(添加FirstName)
request:
url: App.Cookbook.GetCookbookBySellerId
method: POST
data:
page: 1
SellerId: 4
FirstName: "jxnr"
validate:
- eq: ["content.ret", 200]
#获取单个菜品信息
- test:
name: 获取单个菜品信息
request:
url: App.Cookbook.GetCookbookById
method: POST
data:
id: 2
validate:
- eq: ["content.ret", 200]
#修改单个菜品信息
- test:
name: 修改单个菜品信息
request:
url: App.Cookbook.SetCookbookById
method: POST
validate:
- eq: ["content.ret", 200]
- test:
name: 修改单个菜品信息
request:
url: App.Cookbook.SetCookbookById
method: POST
validate:
- eq: ["content.ret", 200]
... ...
... ... @@ -3,8 +3,7 @@
request:
base_url: http://dc1.colorcun.com:10005?s=
# 添加菜谱失败的情况
#添加菜谱
- test:
name: 添加菜谱(正确操作)
variable_binds:
... ... @@ -12,7 +11,7 @@
- sellerid: "15"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_menu($name,$sellerid,$status,$image)}
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -27,7 +26,7 @@
- sellerid: "15"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_menu_noname($sellerid,$status,$image)}
- multipart_encoder: ${get_data(sellerid=$sellerid,status=$status,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -43,7 +42,7 @@
- name: "菜谱测试1"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_menu_noid($name,$status,$image)}
- multipart_encoder: ${get_data(name=$name,status=$status,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -59,7 +58,7 @@
- name: "菜谱测试1"
- sellerid: "15"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${get_menu_nostatus($name,$sellerid,$image)}
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,image=$image)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -75,7 +74,7 @@
- name: "菜谱测试1"
- sellerid: "15"
- status: "1"
- multipart_encoder: ${get_menu_noimage($name,$sellerid,$status)}
- multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status)}
request:
url: App.Menu.AddMenu
method: POST
... ... @@ -86,7 +85,7 @@
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:缺少上传文件:image"]
#根据菜谱ID获取关联菜品
- test:
name: 根据菜谱ID获取关联菜品(正确操作)
request:
... ... @@ -109,7 +108,7 @@
- eq: ["content.msg", "非法请求:暂无关联菜品"]
#根据菜谱ID获取关联菜品数量
- test:
name: 根据菜谱ID获取关联菜品数量(有关联菜品)
request:
... ... @@ -129,7 +128,7 @@
validate:
- eq: ["content.ret", 200]
#根据菜谱ID获取菜谱基本信息
- test:
name: 根据菜谱ID获取菜谱基本信息(正确操作)
request:
... ... @@ -151,7 +150,7 @@
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无菜谱"]
#根据商家ID获取菜谱信息
- test:
name: 根据商家ID获取菜谱信息(正确操作)
request:
... ... @@ -172,7 +171,7 @@
- eq: ["content.ret", 400]
- eq: ["content.msg", "非法请求:暂无菜谱"]
#根据菜谱ID修改菜谱信息
- test:
name: 根据菜谱ID修改菜谱信息(正确操作)
variable_binds:
... ... @@ -180,7 +179,7 @@
- name: "菜谱修改1"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_menu($id,$name,$status,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,status=$status,image=$image)}
request:
url: App.Menu.SetMenuById
method: POST
... ... @@ -195,7 +194,7 @@
- name: "菜谱修改1"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_menu_noid($name,$status,$image)}
- multipart_encoder: ${get_data(name=$name,status=$status,image=$image)}
request:
url: App.Menu.SetMenuById
method: POST
... ... @@ -211,7 +210,7 @@
- id: "20"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_menu_noname($id,$status,$image)}
- multipart_encoder: ${get_data(id=$id,status=$status,image=$image)}
request:
url: App.Menu.SetMenuById
method: POST
... ... @@ -227,7 +226,7 @@
- id: "20"
- name: "菜谱修改1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_menu_nostatus($id,$name,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,image=$image)}
request:
url: App.Menu.SetMenuById
method: POST
... ... @@ -243,7 +242,7 @@
- id: "20"
- name: "菜谱修改1"
- status: "1"
- multipart_encoder: ${set_menu_noimage($id,$name,$status)}
- multipart_encoder: ${get_data(id=$id,name=$name,status=$status)}
request:
url: App.Menu.SetMenuById
method: POST
... ... @@ -260,7 +259,7 @@
- name: "菜谱修改1"
- status: "1"
- image: "/Users/orange/cover.jpeg"
- multipart_encoder: ${set_menu($id,$name,$status,$image)}
- multipart_encoder: ${get_data(id=$id,name=$name,status=$status,image=$image)}
request:
url: App.Menu.SetMenuById
method: POST
... ...