Commit a1731c25de2e85d91454af6160c8b1b6011327da

Authored by yangfan
1 parent 79a72b62

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

  1 +import sys
  2 +reload(sys)
  3 +sys.setdefaultencoding('utf8')
  4 +import mysql.connector
  5 +
  6 +
  7 +conn = mysql.connector.connect(
  8 + user = 'root',
  9 + password = 'LeCunKe20170215',
  10 + host = '123.56.79.57',
  11 + database = 'xt-dc'
  12 +)
  13 +cur = conn.cursor()
  14 +
  15 +
  16 +query = ("SELECT id,name FROM xt_seller")
  17 +
  18 +
  19 +cur.execute(query)
  20 +
  21 +for (id, name) in cur:
  22 + print("{}, {}".format(id, name))
  23 +
  24 +cur.close()
  25 +conn.close()
1 from requests_toolbelt import MultipartEncoder 1 from requests_toolbelt import MultipartEncoder
2 import requests 2 import requests
  3 +import sys
  4 +import json
  5 +reload(sys)
  6 +sys.setdefaultencoding('utf8')
3 7
4 -def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath): 8 +
  9 +def get_data(name, phone, map_address, longPoint, latPoint, filePath, imagePath):
5 m = MultipartEncoder( 10 m = MultipartEncoder(
6 fields={ 11 fields={
7 'name': name, 12 'name': name,
@@ -14,7 +19,9 @@ def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath): @@ -14,7 +19,9 @@ def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
14 } 19 }
15 ) 20 )
16 return m 21 return m
17 -def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath): 22 +
  23 +
  24 +def get_data_noname(phone, map_address, longPoint, latPoint, filePath, imagePath):
18 m = MultipartEncoder( 25 m = MultipartEncoder(
19 fields={ 26 fields={
20 'phone': phone, 27 'phone': phone,
@@ -26,7 +33,9 @@ def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath): @@ -26,7 +33,9 @@ def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath):
26 } 33 }
27 ) 34 )
28 return m 35 return m
29 -def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath): 36 +
  37 +
  38 +def get_data_nophone(name, map_address, longPoint, latPoint, filePath, imagePath):
30 m = MultipartEncoder( 39 m = MultipartEncoder(
31 fields={ 40 fields={
32 'name': name, 41 'name': name,
@@ -38,7 +47,9 @@ def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath): @@ -38,7 +47,9 @@ def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath):
38 } 47 }
39 ) 48 )
40 return m 49 return m
41 -def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath): 50 +
  51 +
  52 +def get_data_nomapaddress(name, phone, longPoint, latPoint, filePath, imagePath):
42 m = MultipartEncoder( 53 m = MultipartEncoder(
43 fields={ 54 fields={
44 'name': name, 55 'name': name,
@@ -50,7 +61,9 @@ def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath): @@ -50,7 +61,9 @@ def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath):
50 } 61 }
51 ) 62 )
52 return m 63 return m
53 -def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath): 64 +
  65 +
  66 +def get_data_nofile(name, phone, map_address, longPoint, latPoint, imagePath):
54 m = MultipartEncoder( 67 m = MultipartEncoder(
55 fields={ 68 fields={
56 'name': name, 69 'name': name,
@@ -62,7 +75,9 @@ def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath): @@ -62,7 +75,9 @@ def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath):
62 } 75 }
63 ) 76 )
64 return m 77 return m
65 -def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath): 78 +
  79 +
  80 +def get_data_noimage(name, phone, map_address, longPoint, latPoint, filePath):
66 m = MultipartEncoder( 81 m = MultipartEncoder(
67 fields={ 82 fields={
68 'name': name, 83 'name': name,
@@ -74,7 +89,9 @@ def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath): @@ -74,7 +89,9 @@ def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath):
74 } 89 }
75 ) 90 )
76 return m 91 return m
77 -def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath): 92 +
  93 +
  94 +def get_data_nolong(name, phone, map_address, latPoint, filePath, imagePath):
78 m = MultipartEncoder( 95 m = MultipartEncoder(
79 fields={ 96 fields={
80 'name': name, 97 'name': name,
@@ -86,7 +103,9 @@ def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath): @@ -86,7 +103,9 @@ def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath):
86 } 103 }
87 ) 104 )
88 return m 105 return m
89 -def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath): 106 +
  107 +
  108 +def get_data_nolat(name, phone, map_address, longPoint, filePath, imagePath):
90 m = MultipartEncoder( 109 m = MultipartEncoder(
91 fields={ 110 fields={
92 'name': name, 111 'name': name,
@@ -98,10 +117,13 @@ def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath): @@ -98,10 +117,13 @@ def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath):
98 } 117 }
99 ) 118 )
100 return m 119 return m
  120 +
  121 +
101 def get_content_type(data): 122 def get_content_type(data):
102 return data.content_type 123 return data.content_type
103 124
104 -def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePath): 125 +
  126 +def set_data(sellerid, name, phone, map_address, longPoint, latPoint, filePath, imagePath):
105 m = MultipartEncoder( 127 m = MultipartEncoder(
106 fields={ 128 fields={
107 'id': sellerid, 129 'id': sellerid,
@@ -115,7 +137,9 @@ def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePa @@ -115,7 +137,9 @@ def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePa
115 } 137 }
116 ) 138 )
117 return m 139 return m
118 -def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath): 140 +
  141 +
  142 +def set_data_noid(name, phone, map_address, longPoint, latPoint, filePath, imagePath):
119 m = MultipartEncoder( 143 m = MultipartEncoder(
120 fields={ 144 fields={
121 'name': name, 145 'name': name,
@@ -128,7 +152,9 @@ def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath): @@ -128,7 +152,9 @@ def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
128 } 152 }
129 ) 153 )
130 return m 154 return m
131 -def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,imagePath): 155 +
  156 +
  157 +def set_data_noname(sellerid, phone, map_address, longPoint, latPoint, filePath, imagePath):
132 m = MultipartEncoder( 158 m = MultipartEncoder(
133 fields={ 159 fields={
134 'id': sellerid, 160 'id': sellerid,
@@ -141,7 +167,9 @@ def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,image @@ -141,7 +167,9 @@ def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,image
141 } 167 }
142 ) 168 )
143 return m 169 return m
144 -def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,imagePath): 170 +
  171 +
  172 +def set_data_nophone(sellerid, name, map_address, longPoint, latPoint, filePath, imagePath):
145 m = MultipartEncoder( 173 m = MultipartEncoder(
146 fields={ 174 fields={
147 'id': sellerid, 175 'id': sellerid,
@@ -154,7 +182,9 @@ def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,image @@ -154,7 +182,9 @@ def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,image
154 } 182 }
155 ) 183 )
156 return m 184 return m
157 -def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imagePath): 185 +
  186 +
  187 +def set_data_nomapaddress(sellerid, name, phone, longPoint, latPoint, filePath, imagePath):
158 m = MultipartEncoder( 188 m = MultipartEncoder(
159 fields={ 189 fields={
160 'id': sellerid, 190 'id': sellerid,
@@ -167,7 +197,9 @@ def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imageP @@ -167,7 +197,9 @@ def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imageP
167 } 197 }
168 ) 198 )
169 return m 199 return m
170 -def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath): 200 +
  201 +
  202 +def set_data_nolong(sellerid, name, phone, map_address, latPoint, filePath, imagePath):
171 m = MultipartEncoder( 203 m = MultipartEncoder(
172 fields={ 204 fields={
173 'id': sellerid, 205 'id': sellerid,
@@ -180,7 +212,9 @@ def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath) @@ -180,7 +212,9 @@ def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath)
180 } 212 }
181 ) 213 )
182 return m 214 return m
183 -def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath): 215 +
  216 +
  217 +def set_data_nolat(sellerid, name, phone, map_address, longPoint, filePath, imagePath):
184 m = MultipartEncoder( 218 m = MultipartEncoder(
185 fields={ 219 fields={
186 'id': sellerid, 220 'id': sellerid,
@@ -193,7 +227,9 @@ def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath) @@ -193,7 +227,9 @@ def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath)
193 } 227 }
194 ) 228 )
195 return m 229 return m
196 -def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath): 230 +
  231 +
  232 +def set_data_nofile(sellerid, name, phone, map_address, longPoint, latPoint, imagePath):
197 m = MultipartEncoder( 233 m = MultipartEncoder(
198 fields={ 234 fields={
199 'id': sellerid, 235 'id': sellerid,
@@ -206,7 +242,9 @@ def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath @@ -206,7 +242,9 @@ def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath
206 } 242 }
207 ) 243 )
208 return m 244 return m
209 -def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath): 245 +
  246 +
  247 +def set_data_noimage(sellerid, name, phone, map_address, longPoint, latPoint, filePath):
210 m = MultipartEncoder( 248 m = MultipartEncoder(
211 fields={ 249 fields={
212 'id': sellerid, 250 'id': sellerid,
@@ -219,7 +257,9 @@ def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath @@ -219,7 +257,9 @@ def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath
219 } 257 }
220 ) 258 )
221 return m 259 return m
222 -def get_menu(name,sellerid,status,imagePath): 260 +
  261 +
  262 +def get_menu(name, sellerid, status, imagePath):
223 m = MultipartEncoder( 263 m = MultipartEncoder(
224 fields={ 264 fields={
225 'name': name, 265 'name': name,
@@ -229,7 +269,9 @@ def get_menu(name,sellerid,status,imagePath): @@ -229,7 +269,9 @@ def get_menu(name,sellerid,status,imagePath):
229 } 269 }
230 ) 270 )
231 return m 271 return m
232 -def get_menu_noname(sellerid,status,imagePath): 272 +
  273 +
  274 +def get_menu_noname(sellerid, status, imagePath):
233 m = MultipartEncoder( 275 m = MultipartEncoder(
234 fields={ 276 fields={
235 'sellerid': sellerid, 277 'sellerid': sellerid,
@@ -238,7 +280,9 @@ def get_menu_noname(sellerid,status,imagePath): @@ -238,7 +280,9 @@ def get_menu_noname(sellerid,status,imagePath):
238 } 280 }
239 ) 281 )
240 return m 282 return m
241 -def get_menu_noid(name,status,imagePath): 283 +
  284 +
  285 +def get_menu_noid(name, status, imagePath):
242 m = MultipartEncoder( 286 m = MultipartEncoder(
243 fields={ 287 fields={
244 'name': name, 288 'name': name,
@@ -247,7 +291,9 @@ def get_menu_noid(name,status,imagePath): @@ -247,7 +291,9 @@ def get_menu_noid(name,status,imagePath):
247 } 291 }
248 ) 292 )
249 return m 293 return m
250 -def get_menu_nostatus(name,sellerid,imagePath): 294 +
  295 +
  296 +def get_menu_nostatus(name, sellerid, imagePath):
251 m = MultipartEncoder( 297 m = MultipartEncoder(
252 fields={ 298 fields={
253 'name': name, 299 'name': name,
@@ -256,7 +302,9 @@ def get_menu_nostatus(name,sellerid,imagePath): @@ -256,7 +302,9 @@ def get_menu_nostatus(name,sellerid,imagePath):
256 } 302 }
257 ) 303 )
258 return m 304 return m
259 -def get_menu_noimage(name,sellerid,status): 305 +
  306 +
  307 +def get_menu_noimage(name, sellerid, status):
260 m = MultipartEncoder( 308 m = MultipartEncoder(
261 fields={ 309 fields={
262 'name': name, 310 'name': name,
@@ -265,7 +313,9 @@ def get_menu_noimage(name,sellerid,status): @@ -265,7 +313,9 @@ def get_menu_noimage(name,sellerid,status):
265 } 313 }
266 ) 314 )
267 return m 315 return m
268 -def set_menu(menuid,name,status,imagePath): 316 +
  317 +
  318 +def set_menu(menuid, name, status, imagePath):
269 m = MultipartEncoder( 319 m = MultipartEncoder(
270 fields={ 320 fields={
271 'id': menuid, 321 'id': menuid,
@@ -275,7 +325,9 @@ def set_menu(menuid,name,status,imagePath): @@ -275,7 +325,9 @@ def set_menu(menuid,name,status,imagePath):
275 } 325 }
276 ) 326 )
277 return m 327 return m
278 -def set_menu_noid(name,status,imagePath): 328 +
  329 +
  330 +def set_menu_noid(name, status, imagePath):
279 m = MultipartEncoder( 331 m = MultipartEncoder(
280 fields={ 332 fields={
281 'name': name, 333 'name': name,
@@ -284,7 +336,9 @@ def set_menu_noid(name,status,imagePath): @@ -284,7 +336,9 @@ def set_menu_noid(name,status,imagePath):
284 } 336 }
285 ) 337 )
286 return m 338 return m
287 -def set_menu_noname(menuid,status,imagePath): 339 +
  340 +
  341 +def set_menu_noname(menuid, status, imagePath):
288 m = MultipartEncoder( 342 m = MultipartEncoder(
289 fields={ 343 fields={
290 'id': menuid, 344 'id': menuid,
@@ -293,7 +347,9 @@ def set_menu_noname(menuid,status,imagePath): @@ -293,7 +347,9 @@ def set_menu_noname(menuid,status,imagePath):
293 } 347 }
294 ) 348 )
295 return m 349 return m
296 -def set_menu_nostatus(menuid,name,imagePath): 350 +
  351 +
  352 +def set_menu_nostatus(menuid, name, imagePath):
297 m = MultipartEncoder( 353 m = MultipartEncoder(
298 fields={ 354 fields={
299 'id': menuid, 355 'id': menuid,
@@ -302,7 +358,9 @@ def set_menu_nostatus(menuid,name,imagePath): @@ -302,7 +358,9 @@ def set_menu_nostatus(menuid,name,imagePath):
302 } 358 }
303 ) 359 )
304 return m 360 return m
305 -def set_menu_noimage(menuid,name,status): 361 +
  362 +
  363 +def set_menu_noimage(menuid, name, status):
306 m = MultipartEncoder( 364 m = MultipartEncoder(
307 fields={ 365 fields={
308 'id': menuid, 366 'id': menuid,
@@ -310,4 +368,26 @@ def set_menu_noimage(menuid,name,status): @@ -310,4 +368,26 @@ def set_menu_noimage(menuid,name,status):
310 'status': status 368 'status': status
311 } 369 }
312 ) 370 )
313 - return m  
  371 + return m
  372 +
  373 +
  374 +def get_cook(**args):
  375 + fields = {}
  376 + for key in args:
  377 + if key == "image":
  378 + fields[key] = ("image", open(bytes(args[key]), "rb"), "image/jpeg")
  379 + else:
  380 + fields[key] = bytes(args[key])
  381 + m = MultipartEncoder(fields)
  382 + return m
  383 +
  384 +
  385 +def get_data(**args):
  386 + fields = {}
  387 + for key in args:
  388 + if key == "image" or key == "file":
  389 + fields[key] = ("image", open(bytes(args[key]), "rb"), "image/jpeg")
  390 + else:
  391 + fields[key] = bytes(args[key])
  392 + m = MultipartEncoder(fields)
  393 + return m
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 request: 3 request:
4 base_url: http://dc1.colorcun.com:10005?s= 4 base_url: http://dc1.colorcun.com:10005?s=
5 5
  6 +#添加商家信息
6 - test: 7 - test:
7 name: 添加商家信息(正确操作) 8 name: 添加商家信息(正确操作)
8 variable_binds: 9 variable_binds:
@@ -13,7 +14,7 @@ @@ -13,7 +14,7 @@
13 - lat: "456" 14 - lat: "456"
14 - file: "/Users/orange/cover.jpeg" 15 - file: "/Users/orange/cover.jpeg"
15 - image: "/Users/orange/cover.jpeg" 16 - image: "/Users/orange/cover.jpeg"
16 - - multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)} 17 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
17 request: 18 request:
18 url: App.Seller.AddSeller 19 url: App.Seller.AddSeller
19 method: POST 20 method: POST
@@ -32,7 +33,7 @@ @@ -32,7 +33,7 @@
32 - lat: "456" 33 - lat: "456"
33 - file: "/Users/orange/cover.jpeg" 34 - file: "/Users/orange/cover.jpeg"
34 - image: "/Users/orange/cover.jpeg" 35 - image: "/Users/orange/cover.jpeg"
35 - - multipart_encoder: ${get_data_noname($phone,$map_address,$long,$lat,$file,$image)} 36 + - multipart_encoder: ${get_data(phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
36 request: 37 request:
37 url: App.Seller.AddSeller 38 url: App.Seller.AddSeller
38 method: POST 39 method: POST
@@ -52,7 +53,7 @@ @@ -52,7 +53,7 @@
52 - lat: "456" 53 - lat: "456"
53 - file: "/Users/orange/cover.jpeg" 54 - file: "/Users/orange/cover.jpeg"
54 - image: "/Users/orange/cover.jpeg" 55 - image: "/Users/orange/cover.jpeg"
55 - - multipart_encoder: ${get_data_nophone($name,$map_address,$long,$lat,$file,$image)} 56 + - multipart_encoder: ${get_data(name=$name,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
56 request: 57 request:
57 url: App.Seller.AddSeller 58 url: App.Seller.AddSeller
58 method: POST 59 method: POST
@@ -72,7 +73,7 @@ @@ -72,7 +73,7 @@
72 - lat: "456" 73 - lat: "456"
73 - file: "/Users/orange/cover.jpeg" 74 - file: "/Users/orange/cover.jpeg"
74 - image: "/Users/orange/cover.jpeg" 75 - image: "/Users/orange/cover.jpeg"
75 - - multipart_encoder: ${get_data_nomapaddress($name,$phone,$long,$lat,$file,$image)} 76 + - multipart_encoder: ${get_data(name=$name,phone=$phone,long=$long,lat=$lat,file=$file,image=$image)}
76 request: 77 request:
77 url: App.Seller.AddSeller 78 url: App.Seller.AddSeller
78 method: POST 79 method: POST
@@ -91,7 +92,7 @@ @@ -91,7 +92,7 @@
91 - long: "123" 92 - long: "123"
92 - lat: "456" 93 - lat: "456"
93 - image: "/Users/orange/cover.jpeg" 94 - image: "/Users/orange/cover.jpeg"
94 - - multipart_encoder: ${get_data_nofile($name,$phone,$map_address,$long,$lat,$image)} 95 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,image=$image)}
95 request: 96 request:
96 url: App.Seller.AddSeller 97 url: App.Seller.AddSeller
97 method: POST 98 method: POST
@@ -110,7 +111,7 @@ @@ -110,7 +111,7 @@
110 - long: "123" 111 - long: "123"
111 - lat: "456" 112 - lat: "456"
112 - file: "/Users/orange/cover.jpeg" 113 - file: "/Users/orange/cover.jpeg"
113 - - multipart_encoder: ${get_data_noimage($name,$phone,$map_address,$long,$lat,$file)} 114 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file)}
114 request: 115 request:
115 url: App.Seller.AddSeller 116 url: App.Seller.AddSeller
116 method: POST 117 method: POST
@@ -129,7 +130,7 @@ @@ -129,7 +130,7 @@
129 - lat: "456" 130 - lat: "456"
130 - file: "/Users/orange/cover.jpeg" 131 - file: "/Users/orange/cover.jpeg"
131 - image: "/Users/orange/cover.jpeg" 132 - image: "/Users/orange/cover.jpeg"
132 - - multipart_encoder: ${get_data_nolong($name,$phone,$map_address,$lat,$file,$image)} 133 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,lat=$lat,file=$file,image=$image)}
133 request: 134 request:
134 url: App.Seller.AddSeller 135 url: App.Seller.AddSeller
135 method: POST 136 method: POST
@@ -148,7 +149,7 @@ @@ -148,7 +149,7 @@
148 - long: "123" 149 - long: "123"
149 - file: "/Users/orange/cover.jpeg" 150 - file: "/Users/orange/cover.jpeg"
150 - image: "/Users/orange/cover.jpeg" 151 - image: "/Users/orange/cover.jpeg"
151 - - multipart_encoder: ${get_data_nolat($name,$phone,$map_address,$long,$file,$image)} 152 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,file=$file,image=$image)}
152 request: 153 request:
153 url: App.Seller.AddSeller 154 url: App.Seller.AddSeller
154 method: POST 155 method: POST
@@ -168,7 +169,7 @@ @@ -168,7 +169,7 @@
168 - lat: "456" 169 - lat: "456"
169 - file: "/Users/orange/cover.jpeg" 170 - file: "/Users/orange/cover.jpeg"
170 - image: "/Users/orange/cover.jpeg" 171 - image: "/Users/orange/cover.jpeg"
171 - - multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)} 172 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
172 request: 173 request:
173 url: App.Seller.AddSeller 174 url: App.Seller.AddSeller
174 method: POST 175 method: POST
@@ -188,7 +189,7 @@ @@ -188,7 +189,7 @@
188 - lat: "456" 189 - lat: "456"
189 - file: "/Users/orange/cover.jpeg" 190 - file: "/Users/orange/cover.jpeg"
190 - image: "/Users/orange/cover.jpeg" 191 - image: "/Users/orange/cover.jpeg"
191 - - multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)} 192 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
192 request: 193 request:
193 url: App.Seller.AddSeller 194 url: App.Seller.AddSeller
194 method: POST 195 method: POST
@@ -199,9 +200,7 @@ @@ -199,9 +200,7 @@
199 - eq: ["content.ret", 398] 200 - eq: ["content.ret", 398]
200 - eq: ["content.msg","非法请求:手机号已存在"] 201 - eq: ["content.msg","非法请求:手机号已存在"]
201 202
202 -  
203 -  
204 - 203 +#获取商家列表数据
205 - test: 204 - test:
206 name: 获取商家列表数据(查询第一页) 205 name: 获取商家列表数据(查询第一页)
207 request: 206 request:
@@ -222,7 +221,7 @@ @@ -222,7 +221,7 @@
222 - eq: ["content.ret", 396] 221 - eq: ["content.ret", 396]
223 - eq: ["content.msg","非法请求:暂无商家"] 222 - eq: ["content.msg","非法请求:暂无商家"]
224 223
225 - 224 +#根据商家ID获取商家信息
226 - test: 225 - test:
227 name: 根据商家ID获取商家信息(sellerid=5) 226 name: 根据商家ID获取商家信息(sellerid=5)
228 request: 227 request:
@@ -244,8 +243,7 @@ @@ -244,8 +243,7 @@
244 - eq: ["content.ret", 396] 243 - eq: ["content.ret", 396]
245 - eq: ["content.msg","非法请求:暂无商家"] 244 - eq: ["content.msg","非法请求:暂无商家"]
246 245
247 -  
248 - 246 +#根据商家ID修改商家信息
249 - test: 247 - test:
250 name: 根据商家ID修改商家信息(正确操作) 248 name: 根据商家ID修改商家信息(正确操作)
251 variable_binds: 249 variable_binds:
@@ -257,7 +255,7 @@ @@ -257,7 +255,7 @@
257 - lat: "456" 255 - lat: "456"
258 - file: "/Users/orange/cover.jpeg" 256 - file: "/Users/orange/cover.jpeg"
259 - image: "/Users/orange/cover.jpeg" 257 - image: "/Users/orange/cover.jpeg"
260 - - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)} 258 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
261 request: 259 request:
262 url: App.Seller.SetSellerById 260 url: App.Seller.SetSellerById
263 method: POST 261 method: POST
@@ -276,7 +274,7 @@ @@ -276,7 +274,7 @@
276 - lat: "456" 274 - lat: "456"
277 - file: "/Users/orange/cover.jpeg" 275 - file: "/Users/orange/cover.jpeg"
278 - image: "/Users/orange/cover.jpeg" 276 - image: "/Users/orange/cover.jpeg"
279 - - multipart_encoder: ${set_data_noid($name,$phone,$map_address,$long,$lat,$file,$image)} 277 + - multipart_encoder: ${get_data(name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
280 request: 278 request:
281 url: App.Seller.SetSellerById 279 url: App.Seller.SetSellerById
282 method: POST 280 method: POST
@@ -296,7 +294,7 @@ @@ -296,7 +294,7 @@
296 - lat: "456" 294 - lat: "456"
297 - file: "/Users/orange/cover.jpeg" 295 - file: "/Users/orange/cover.jpeg"
298 - image: "/Users/orange/cover.jpeg" 296 - image: "/Users/orange/cover.jpeg"
299 - - multipart_encoder: ${set_data_noname($id,$phone,$map_address,$long,$lat,$file,$image)} 297 + - multipart_encoder: ${get_data(id=$id,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
300 request: 298 request:
301 url: App.Seller.SetSellerById 299 url: App.Seller.SetSellerById
302 method: POST 300 method: POST
@@ -316,7 +314,7 @@ @@ -316,7 +314,7 @@
316 - lat: "456" 314 - lat: "456"
317 - file: "/Users/orange/cover.jpeg" 315 - file: "/Users/orange/cover.jpeg"
318 - image: "/Users/orange/cover.jpeg" 316 - image: "/Users/orange/cover.jpeg"
319 - - multipart_encoder: ${set_data_nophone($id,$name,$map_address,$long,$lat,$file,$image)} 317 + - multipart_encoder: ${get_data(id=$id,name=$name,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
320 request: 318 request:
321 url: App.Seller.SetSellerById 319 url: App.Seller.SetSellerById
322 method: POST 320 method: POST
@@ -336,7 +334,7 @@ @@ -336,7 +334,7 @@
336 - lat: "456" 334 - lat: "456"
337 - file: "/Users/orange/cover.jpeg" 335 - file: "/Users/orange/cover.jpeg"
338 - image: "/Users/orange/cover.jpeg" 336 - image: "/Users/orange/cover.jpeg"
339 - - multipart_encoder: ${set_data_nomapaddress($id,$name,$phone,$long,$lat,$file,$image)} 337 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,long=$long,lat=$lat,file=$file,image=$image)}
340 request: 338 request:
341 url: App.Seller.SetSellerById 339 url: App.Seller.SetSellerById
342 method: POST 340 method: POST
@@ -356,7 +354,7 @@ @@ -356,7 +354,7 @@
356 - lat: "456" 354 - lat: "456"
357 - file: "/Users/orange/cover.jpeg" 355 - file: "/Users/orange/cover.jpeg"
358 - image: "/Users/orange/cover.jpeg" 356 - image: "/Users/orange/cover.jpeg"
359 - - multipart_encoder: ${set_data_nolong($id,$name,$phone,$map_address,$lat,$file,$image)} 357 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,lat=$lat,file=$file,image=$image)}
360 request: 358 request:
361 url: App.Seller.SetSellerById 359 url: App.Seller.SetSellerById
362 method: POST 360 method: POST
@@ -376,7 +374,7 @@ @@ -376,7 +374,7 @@
376 - long: "123" 374 - long: "123"
377 - file: "/Users/orange/cover.jpeg" 375 - file: "/Users/orange/cover.jpeg"
378 - image: "/Users/orange/cover.jpeg" 376 - image: "/Users/orange/cover.jpeg"
379 - - multipart_encoder: ${set_data_nolat($id,$name,$phone,$map_address,$long,$file,$image)} 377 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,file=$file,image=$image)}
380 request: 378 request:
381 url: App.Seller.SetSellerById 379 url: App.Seller.SetSellerById
382 method: POST 380 method: POST
@@ -396,7 +394,7 @@ @@ -396,7 +394,7 @@
396 - long: "123" 394 - long: "123"
397 - lat: "456" 395 - lat: "456"
398 - image: "/Users/orange/cover.jpeg" 396 - image: "/Users/orange/cover.jpeg"
399 - - multipart_encoder: ${set_data_nofile($id,$name,$phone,$map_address,$long,$lat,$image)} 397 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,image=$image)}
400 request: 398 request:
401 url: App.Seller.SetSellerById 399 url: App.Seller.SetSellerById
402 method: POST 400 method: POST
@@ -416,7 +414,7 @@ @@ -416,7 +414,7 @@
416 - long: "123" 414 - long: "123"
417 - lat: "456" 415 - lat: "456"
418 - file: "/Users/orange/cover.jpeg" 416 - file: "/Users/orange/cover.jpeg"
419 - - multipart_encoder: ${set_data_noimage($id,$name,$phone,$map_address,$long,$lat,$file)} 417 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file)}
420 request: 418 request:
421 url: App.Seller.SetSellerById 419 url: App.Seller.SetSellerById
422 method: POST 420 method: POST
@@ -437,7 +435,7 @@ @@ -437,7 +435,7 @@
437 - lat: "456" 435 - lat: "456"
438 - file: "/Users/orange/cover.jpeg" 436 - file: "/Users/orange/cover.jpeg"
439 - image: "/Users/orange/cover.jpeg" 437 - image: "/Users/orange/cover.jpeg"
440 - - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)} 438 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
441 request: 439 request:
442 url: App.Seller.AddSeller 440 url: App.Seller.AddSeller
443 method: POST 441 method: POST
@@ -458,7 +456,7 @@ @@ -458,7 +456,7 @@
458 - lat: "456" 456 - lat: "456"
459 - file: "/Users/orange/cover.jpeg" 457 - file: "/Users/orange/cover.jpeg"
460 - image: "/Users/orange/cover.jpeg" 458 - image: "/Users/orange/cover.jpeg"
461 - - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)} 459 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
462 request: 460 request:
463 url: App.Seller.AddSeller 461 url: App.Seller.AddSeller
464 method: POST 462 method: POST
@@ -479,7 +477,7 @@ @@ -479,7 +477,7 @@
479 - lat: "456" 477 - lat: "456"
480 - file: "/Users/orange/cover.jpeg" 478 - file: "/Users/orange/cover.jpeg"
481 - image: "/Users/orange/cover.jpeg" 479 - image: "/Users/orange/cover.jpeg"
482 - - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)} 480 + - multipart_encoder: ${get_data(id=$id,name=$name,phone=$phone,map_address=$map_address,long=$long,lat=$lat,file=$file,image=$image)}
483 request: 481 request:
484 url: App.Seller.SetSellerById 482 url: App.Seller.SetSellerById
485 method: POST 483 method: POST
  1 +- config:
  2 + name: "桌位服务"
  3 + request:
  4 + base_url: http://dc1.colorcun.com:10005?s=
  5 +
  6 +- test:
  7 + name: 添加商家桌位区域(正确操作)
  8 + request:
  9 + url: App.Tables.AddTableRegion
  10 + method: POST
  11 + data:
  12 + sellerid: 9
  13 + name: "包间"
  14 + validate:
  15 + - eq: ["content.ret", 200]
  16 +- test:
  17 + name: 添加商家桌位区域(不填sellerid)
  18 + request:
  19 + url: App.Tables.AddTableRegion
  20 + method: POST
  21 + data:
  22 + name: "包间"
  23 + validate:
  24 + - eq: ["content.ret", 400]
  25 + - eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
  26 +- test:
  27 + name: 添加商家桌位区域(不填name)
  28 + request:
  29 + url: App.Tables.AddTableRegion
  30 + method: POST
  31 + data:
  32 + sellerid: 9
  33 + validate:
  34 + - eq: ["content.ret", 400]
  35 + - eq: ["content.msg", "非法请求:缺少必要参数name"]
  36 +
  37 +
  38 +- test:
  39 + name: 修改商家桌位区域(修改name)
  40 + request:
  41 + url: App.Tables.AddTable
  42 + method: POST
  43 + data:
  44 + id: 4
  45 + sellerid: 9
  46 + name: "区域修改"
  47 + validate:
  48 + - eq: ["content.ret", 200]
  49 +- test:
  50 + name: 修改商家桌位区域(修改name和order)
  51 + request:
  52 + url: App.Tables.AddTable
  53 + method: POST
  54 + data:
  55 + id: 4
  56 + sellerid: 9
  57 + name: "区域修改"
  58 + order: 10
  59 + validate:
  60 + - eq: ["content.ret", 200]
  61 +- test:
  62 + name: 修改商家桌位区域(修改order)
  63 + request:
  64 + url: App.Tables.AddTable
  65 + method: POST
  66 + data:
  67 + id: 4
  68 + sellerid: 9
  69 + order: 2
  70 + validate:
  71 + - eq: ["content.ret", 200]
  72 +- test:
  73 + name: 修改商家桌位区域(修改失败-不存在的区域)
  74 + request:
  75 + url: App.Tables.AddTable
  76 + method: POST
  77 + data:
  78 + id: 10000
  79 + sellerid: 9
  80 + name: "区域修改"
  81 + order: 10
  82 + validate:
  83 + - eq: ["content.ret", 398]
  84 + - eq: ["content.ret", "非法请求:修改区域失败"]
  85 +
  86 +
  87 +- test:
  88 + name: 获取单条区域信息(正确操作)
  89 + request:
  90 + url: App.Tables.GetRegionById
  91 + method: POST
  92 + data:
  93 + id: 1
  94 + validate:
  95 + - eq: ["content.ret", 200]
  96 +- test:
  97 + name: 获取单条区域信息(暂无数据)
  98 + request:
  99 + url: App.Tables.GetRegionById
  100 + method: POST
  101 + data:
  102 + id: 200
  103 + validate:
  104 + - eq: ["content.ret", 400]
  105 + - eq: ["content.ret", "非法请求:暂无数据"]
  106 +
  107 +- test:
  108 + name: 获取商家桌位列表数据(正确操作)
  109 + request:
  110 + url: App.Tables.GetTableListsBySellerId
  111 + method: POST
  112 + data:
  113 + sellerid: 4
  114 + page: 1
  115 + validate:
  116 + - eq: ["content.ret", 200]
  117 +- test:
  118 + name: 获取商家桌位列表数据(page过大)
  119 + request:
  120 + url: App.Tables.GetTableListsBySellerId
  121 + method: POST
  122 + data:
  123 + sellerid: 4
  124 + page: 100
  125 + validate:
  126 + - eq: ["content.ret", 400]
  127 + - eq: ["content.msg", "非法请求:暂无数据"]
  128 +- test:
  129 + name: 获取商家桌位列表数据(不填sellerid)
  130 + request:
  131 + url: App.Tables.GetTableListsBySellerId
  132 + method: POST
  133 + data:
  134 + page: 1
  135 + validate:
  136 + - eq: ["content.ret", 400]
  137 + - eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
  138 +- test:
  139 + name: 获取商家桌位列表数据(不填page)
  140 + request:
  141 + url: App.Tables.GetTableListsBySellerId
  142 + method: POST
  143 + data:
  144 + sellerid: 4
  145 + validate:
  146 + - eq: ["content.ret", 400]
  147 + - eq: ["content.msg", "非法请求:缺少必要参数page"]
  148 +
  149 +
  150 +- test:
  151 + name: 添加商家桌位信息(正确操作)
  152 + request:
  153 + url: App.Tables.AddTable
  154 + method: POST
  155 + data:
  156 + rid: 4
  157 + sellerid: 9
  158 + name: "杏花阁"
  159 + table_no: "001"
  160 + table_pnum: 10
  161 + validate:
  162 + - eq: ["content.ret", 200]
  163 +- test:
  164 + name: 添加商家桌位信息(不填rid)
  165 + request:
  166 + url: App.Tables.AddTable
  167 + method: POST
  168 + data:
  169 + sellerid: 9
  170 + name: "杏花阁"
  171 + table_no: "001"
  172 + table_pnum: 10
  173 + validate:
  174 + - eq: ["content.ret", 400]
  175 + - eq: ["content.msg", "非法请求:缺少必要参数rid"]
  176 +- test:
  177 + name: 添加商家桌位信息(不填sellerid)
  178 + request:
  179 + url: App.Tables.AddTable
  180 + method: POST
  181 + data:
  182 + rid: 4
  183 + name: "杏花阁"
  184 + table_no: "001"
  185 + table_pnum: 10
  186 + validate:
  187 + - eq: ["content.ret", 400]
  188 + - eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
  189 +- test:
  190 + name: 添加商家桌位信息(不填name)
  191 + request:
  192 + url: App.Tables.AddTable
  193 + method: POST
  194 + data:
  195 + rid: 4
  196 + sellerid: 9
  197 + table_no: "001"
  198 + table_pnum: 10
  199 + validate:
  200 + - eq: ["content.ret", 400]
  201 + - eq: ["content.msg", "非法请求:缺少必要参数name"]
  202 +- test:
  203 + name: 添加商家桌位信息(不填table_no)
  204 + request:
  205 + url: App.Tables.AddTable
  206 + method: POST
  207 + data:
  208 + rid: 4
  209 + sellerid: 9
  210 + name: "杏花阁"
  211 + table_pnum: 10
  212 + validate:
  213 + - eq: ["content.ret", 400]
  214 + - eq: ["content.msg", "非法请求:缺少必要参数table_no"]
  215 +- test:
  216 + name: 添加商家桌位信息(不填table_pnum)
  217 + request:
  218 + url: App.Tables.AddTable
  219 + method: POST
  220 + data:
  221 + rid: 4
  222 + sellerid: 9
  223 + name: "杏花阁"
  224 + table_no: "001"
  225 + validate:
  226 + - eq: ["content.ret", 400]
  227 + - eq: ["content.msg", "非法请求:缺少必要参数table_pnum"]
  228 +- test:
  229 + name: 添加商家桌位信息(name超过30)
  230 + request:
  231 + url: App.Tables.AddTable
  232 + method: POST
  233 + data:
  234 + rid: 4
  235 + sellerid: 9
  236 + name: "杏花阁杏花阁杏花阁杏花阁"
  237 + table_no: "001"
  238 + table_pnum: 10
  239 + validate:
  240 + - eq: ["content.ret", 400]
  241 +- test:
  242 + name: 添加商家桌位信息(table_pnum超过99)
  243 + request:
  244 + url: App.Tables.AddTable
  245 + method: POST
  246 + data:
  247 + rid: 4
  248 + sellerid: 9
  249 + name: "杏花阁"
  250 + table_no: "001"
  251 + table_pnum: 100
  252 + validate:
  253 + - eq: ["content.ret", 400]
  254 +
  255 +- test:
  256 + name: 修改桌位信息(修改全部)
  257 + request:
  258 + url: App.Tables.SetTableById
  259 + method: POST
  260 + data:
  261 + id: 5
  262 + rid: 10
  263 + name: "杏花阁修改"
  264 + order: 99
  265 + table_no: "010"
  266 + table_pnum: 90
  267 + validate:
  268 + - eq: ["content.ret", 200]
  269 +- test:
  270 + name: 修改桌位信息(不填id)
  271 + request:
  272 + url: App.Tables.SetTableById
  273 + method: POST
  274 + data:
  275 + rid: 10
  276 + name: "杏花阁修改"
  277 + order: 99
  278 + table_no: "010"
  279 + table_pnum: 90
  280 + validate:
  281 + - eq: ["content.ret", 400]
  282 + - eq: ["content.msg", "非法请求:缺少必要参数id"]
  283 +- test:
  284 + name: 修改桌位信息(修改rid)
  285 + request:
  286 + url: App.Tables.SetTableById
  287 + method: POST
  288 + data:
  289 + id: 5
  290 + rid: 99
  291 + validate:
  292 + - eq: ["content.ret", 200]
  293 +- test:
  294 + name: 修改桌位信息(修改name)
  295 + request:
  296 + url: App.Tables.SetTableById
  297 + method: POST
  298 + data:
  299 + id: 5
  300 + name: "杏花阁修改1"
  301 + validate:
  302 + - eq: ["content.ret", 200]
  303 +- test:
  304 + name: 修改桌位信息(修改order)
  305 + request:
  306 + url: App.Tables.SetTableById
  307 + method: POST
  308 + data:
  309 + id: 5
  310 + order: 55
  311 + validate:
  312 + - eq: ["content.ret", 200]
  313 +- test:
  314 + name: 修改桌位信息(修改table_no)
  315 + request:
  316 + url: App.Tables.SetTableById
  317 + method: POST
  318 + data:
  319 + id: 5
  320 + table_no: "099"
  321 + validate:
  322 + - eq: ["content.ret", 200]
  323 +- test:
  324 + name: 修改桌位信息(修改table_pnum)
  325 + request:
  326 + url: App.Tables.SetTableById
  327 + method: POST
  328 + data:
  329 + id: 5
  330 + table_pnum: 55
  331 + validate:
  332 + - eq: ["content.ret", 200]
  333 +- test:
  334 + name: 修改桌位信息(修改失败-不存在的桌台)
  335 + request:
  336 + url: App.Tables.SetTableById
  337 + method: POST
  338 + data:
  339 + id: 500
  340 + rid: 10
  341 + name: "杏花阁修改"
  342 + order: 99
  343 + table_no: "010"
  344 + table_pnum: 90
  345 + validate:
  346 + - eq: ["content.ret", 396]
  347 + - eq: ["content.msg", "非法请求:修改桌台失败"]
  1 +- config:
  2 + name: "菜品服务"
  3 + request:
  4 + base_url: http://dc1.colorcun.com:10005?s=
  5 +
  6 +#添加菜品分类
  7 +- test:
  8 + name: 添加菜品分类(正确操作)
  9 + request:
  10 + url: App.Cookbook.AddCookbookClass
  11 + method: POST
  12 + data:
  13 + sellerid: 1
  14 + class_name: "热菜"
  15 + class_type: "菜品分类"
  16 + order: 1
  17 + validate:
  18 + - eq: ["content.ret", 200]
  19 +- test:
  20 + name: 添加菜品分类(不填sellerid)
  21 + request:
  22 + url: App.Cookbook.AddCookbookClass
  23 + method: POST
  24 + data:
  25 + class_name: "热菜"
  26 + class_type: "菜品分类"
  27 + order: 1
  28 + validate:
  29 + - eq: ["content.ret", 400]
  30 + - eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
  31 +- test:
  32 + name: 添加菜品分类(不填class_name)
  33 + request:
  34 + url: App.Cookbook.AddCookbookClass
  35 + method: POST
  36 + data:
  37 + sellerid: 1
  38 + class_type: "菜品分类"
  39 + order: 1
  40 + validate:
  41 + - eq: ["content.ret", 400]
  42 + - eq: ["content.msg", "非法请求:缺少必要参数class_name"]
  43 +- test:
  44 + name: 添加菜品分类(不填class_type)
  45 + request:
  46 + url: App.Cookbook.AddCookbookClass
  47 + method: POST
  48 + data:
  49 + sellerid: 1
  50 + class_name: "热菜"
  51 + order: 1
  52 + validate:
  53 + - eq: ["content.ret", 400]
  54 + - eq: ["content.msg", "非法请求:缺少必要参数class_type"]
  55 +- test:
  56 + name: 添加菜品分类(不填order)
  57 + request:
  58 + url: App.Cookbook.AddCookbookClass
  59 + method: POST
  60 + data:
  61 + sellerid: 1
  62 + class_name: "热菜"
  63 + class_type: "菜品分类"
  64 + validate:
  65 + - eq: ["content.ret", 400]
  66 + - eq: ["content.msg", "非法请求:缺少必要参数order"]
  67 +
  68 +#修改菜品分类
  69 +- test:
  70 + name: 修改菜品分类(全部修改)
  71 + request:
  72 + url: App.Cookbook.SetCookbookClassById
  73 + method: POST
  74 + data:
  75 + id: 2
  76 + class_name: "热菜修改"
  77 + class_type: "菜品分类修改"
  78 + order: 2
  79 + validate:
  80 + - eq: ["content.ret", 200]
  81 +- test:
  82 + name: 修改菜品分类(只修改class_name)
  83 + request:
  84 + url: App.Cookbook.SetCookbookClassById
  85 + method: POST
  86 + data:
  87 + id: 2
  88 + class_name: "热菜修改"
  89 + validate:
  90 + - eq: ["content.ret", 200]
  91 +- test:
  92 + name: 修改菜品分类(只修改class_type)
  93 + request:
  94 + url: App.Cookbook.SetCookbookClassById
  95 + method: POST
  96 + data:
  97 + id: 2
  98 + class_type: "菜品分类修改"
  99 + validate:
  100 + - eq: ["content.ret", 200]
  101 +- test:
  102 + name: 修改菜品分类(只修改order)
  103 + request:
  104 + url: App.Cookbook.SetCookbookClassById
  105 + method: POST
  106 + data:
  107 + id: 2
  108 + order: 2
  109 + validate:
  110 + - eq: ["content.ret", 200]
  111 +- test:
  112 + name: 修改菜品分类(修改class_name和class_type)
  113 + request:
  114 + url: App.Cookbook.SetCookbookClassById
  115 + method: POST
  116 + data:
  117 + id: 2
  118 + class_name: "热菜修改"
  119 + class_type: "菜品分类修改"
  120 + validate:
  121 + - eq: ["content.ret", 200]
  122 +- test:
  123 + name: 修改菜品分类(修改class_name和order)
  124 + request:
  125 + url: App.Cookbook.SetCookbookClassById
  126 + method: POST
  127 + data:
  128 + id: 2
  129 + class_name: "热菜修改"
  130 + order: 2
  131 + validate:
  132 + - eq: ["content.ret", 200]
  133 +- test:
  134 + name: 修改菜品分类(修改class_type和order)
  135 + request:
  136 + url: App.Cookbook.SetCookbookClassById
  137 + method: POST
  138 + data:
  139 + id: 2
  140 + class_type: "菜品分类修改"
  141 + order: 2
  142 + validate:
  143 + - eq: ["content.ret", 200]
  144 +- test:
  145 + name: 修改菜品分类(不传id)
  146 + request:
  147 + url: App.Cookbook.SetCookbookClassById
  148 + method: POST
  149 + data:
  150 + class_name: "热菜修改"
  151 + class_type: "菜品分类"
  152 + order: 2
  153 + validate:
  154 + - eq: ["content.ret", 400]
  155 + - eq: ["content.ret", "非法请求:缺少必要参数id"]
  156 +#删除菜品分类
  157 +- test:
  158 + name: 删除菜品分类(删除成功)
  159 + request:
  160 + url: App.Cookbook.DelCookbookClassById
  161 + method: POST
  162 + data:
  163 + id: 2
  164 + validate:
  165 + - eq: ["content.ret", 200]
  166 +# - test:
  167 +# name: 删除菜品分类(当前分类下有菜品)
  168 +# request:
  169 +# url: App.Cookbook.DelCookbookClassById
  170 +# method: POST
  171 +# data:
  172 +# id: 3
  173 +# validate:
  174 +# - eq: ["content.ret", 200]
  175 +
  176 +#获取菜品分类
  177 +- test:
  178 + name: 获取菜品分类(正确操作)
  179 + request:
  180 + url: App.Cookbook.GetCookbookClassBySellerId
  181 + method: POST
  182 + data:
  183 + Sellerid: 1
  184 + validate:
  185 + - eq: ["content.ret", 200]
  186 +- test:
  187 + name: 获取菜品分类(不填Sellerid)
  188 + request:
  189 + url: App.Cookbook.GetCookbookClassBySellerId
  190 + method: POST
  191 + validate:
  192 + - eq: ["content.ret", 400]
  193 + - eq: ["content.msg", "非法请求:缺少必要参数SellerId"]
  194 +- test:
  195 + name: 获取菜品分类(暂无分类)
  196 + request:
  197 + url: App.Cookbook.GetCookbookClassBySellerId
  198 + method: POST
  199 + data:
  200 + Sellerid: 1
  201 + validate:
  202 + - eq: ["content.ret", 396]
  203 + - eq: ["content.msg", "非法请求:暂无分类"]
  204 +#获取分类下所有菜品
  205 +- test:
  206 + name: 获取分类下所有菜品(正确操作)
  207 + request:
  208 + url: App.Cookbook.GetCookbookByClassId
  209 + method: POST
  210 + data:
  211 + ClassId: 1
  212 + validate:
  213 + - eq: ["content.ret", 200]
  214 +- test:
  215 + name: 获取分类下所有菜品(不填ClassId)
  216 + request:
  217 + url: App.Cookbook.GetCookbookByClassId
  218 + method: POST
  219 + validate:
  220 + - eq: ["content.ret", 400]
  221 + - eq: ["content.msg", "非法请求:缺少必要参数ClassId"]
  222 +- test:
  223 + name: 获取分类下所有菜品(暂无菜品)
  224 + request:
  225 + url: App.Cookbook.GetCookbookByClassId
  226 + method: POST
  227 + data:
  228 + ClassId: 100
  229 + validate:
  230 + - eq: ["content.ret", 397]
  231 + - eq: ["content.msg", "非法请求:暂无菜品"]
  232 +
  233 +#添加菜品信息
  234 +- test:
  235 + name: 添加菜品信息(正确操作)
  236 + variable_binds:
  237 + - sellerid: "100"
  238 + - mid: "100"
  239 + - cid: "100"
  240 + - unit: "份"
  241 + - name: "测试菜谱"
  242 + - first_name: "测试"
  243 + - search_code: "test"
  244 + - status: "1"
  245 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  246 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  247 + - printid: "1"
  248 + - setup: "1"
  249 + - give: "1"
  250 + - image: "/Users/orange/cover.jpeg"
  251 + - desc: "miaoshu"
  252 + - 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)}
  253 + request:
  254 + url: App.Cookbook.AddCookbook
  255 + method: POST
  256 + headers:
  257 + Content-Type: ${get_content_type($multipart_encoder)}
  258 + data: $multipart_encoder
  259 + validate:
  260 + - eq: ["content.ret", 200]
  261 +- test:
  262 + name: 添加菜品信息(不填写sellerid)
  263 + variable_binds:
  264 + - mid: "100"
  265 + - cid: "100"
  266 + - unit: "份"
  267 + - name: "测试菜谱"
  268 + - first_name: "测试"
  269 + - search_code: "test"
  270 + - status: "1"
  271 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  272 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  273 + - printid: "1"
  274 + - setup: "1"
  275 + - give: "1"
  276 + - image: "/Users/orange/cover.jpeg"
  277 + - desc: "miaoshu"
  278 + - 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)}
  279 + request:
  280 + url: App.Cookbook.AddCookbook
  281 + method: POST
  282 + headers:
  283 + Content-Type: ${get_content_type($multipart_encoder)}
  284 + data: $multipart_encoder
  285 + validate:
  286 + - eq: ["content.ret", 400]
  287 + - eq: ["content.msg", "非法请求:缺少必要参数sellerid"]
  288 +- test:
  289 + name: 添加菜品信息(不填mid)
  290 + variable_binds:
  291 + - sellerid: "100"
  292 + - cid: "100"
  293 + - unit: "份"
  294 + - name: "测试菜谱"
  295 + - first_name: "测试"
  296 + - search_code: "test"
  297 + - status: "1"
  298 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  299 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  300 + - printid: "1"
  301 + - setup: "1"
  302 + - give: "1"
  303 + - image: "/Users/orange/cover.jpeg"
  304 + - desc: "miaoshu"
  305 + - 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)}
  306 + request:
  307 + url: App.Cookbook.AddCookbook
  308 + method: POST
  309 + headers:
  310 + Content-Type: ${get_content_type($multipart_encoder)}
  311 + data: $multipart_encoder
  312 + validate:
  313 + - eq: ["content.ret", 400]
  314 + - eq: ["content.msg", "非法请求:缺少必要参数mid"]
  315 +- test:
  316 + name: 添加菜品信息(不填cid)
  317 + variable_binds:
  318 + - sellerid: "100"
  319 + - mid: "100"
  320 + - unit: "份"
  321 + - name: "测试菜谱"
  322 + - first_name: "测试"
  323 + - search_code: "test"
  324 + - status: "1"
  325 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  326 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  327 + - printid: "1"
  328 + - setup: "1"
  329 + - give: "1"
  330 + - image: "/Users/orange/cover.jpeg"
  331 + - desc: "miaoshu"
  332 + - 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)}
  333 + request:
  334 + url: App.Cookbook.AddCookbook
  335 + method: POST
  336 + headers:
  337 + Content-Type: ${get_content_type($multipart_encoder)}
  338 + data: $multipart_encoder
  339 + validate:
  340 + - eq: ["content.ret", 400]
  341 + - eq: ["content.msg", "非法请求:缺少必要参数cid"]
  342 +- test:
  343 + name: 添加菜品信息(不填unit)
  344 + variable_binds:
  345 + - sellerid: "100"
  346 + - mid: "100"
  347 + - cid: "100"
  348 + - name: "测试菜谱"
  349 + - first_name: "测试"
  350 + - search_code: "test"
  351 + - status: "1"
  352 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  353 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  354 + - printid: "1"
  355 + - setup: "1"
  356 + - give: "1"
  357 + - image: "/Users/orange/cover.jpeg"
  358 + - desc: "miaoshu"
  359 + - 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)}
  360 + request:
  361 + url: App.Cookbook.AddCookbook
  362 + method: POST
  363 + headers:
  364 + Content-Type: ${get_content_type($multipart_encoder)}
  365 + data: $multipart_encoder
  366 + validate:
  367 + - eq: ["content.ret", 400]
  368 + - eq: ["content.msg", "非法请求:缺少必要参数unit"]
  369 +- test:
  370 + name: 添加菜品信息(不填name)
  371 + variable_binds:
  372 + - sellerid: "100"
  373 + - mid: "100"
  374 + - cid: "100"
  375 + - unit: "份"
  376 + - first_name: "测试"
  377 + - search_code: "test"
  378 + - status: "1"
  379 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  380 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  381 + - printid: "1"
  382 + - setup: "1"
  383 + - give: "1"
  384 + - image: "/Users/orange/cover.jpeg"
  385 + - desc: "miaoshu"
  386 + - 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)}
  387 + request:
  388 + url: App.Cookbook.AddCookbook
  389 + method: POST
  390 + headers:
  391 + Content-Type: ${get_content_type($multipart_encoder)}
  392 + data: $multipart_encoder
  393 + validate:
  394 + - eq: ["content.ret", 400]
  395 + - eq: ["content.msg", "非法请求:缺少必要参数name"]
  396 +- test:
  397 + name: 添加菜品信息(不填status)
  398 + variable_binds:
  399 + - sellerid: "100"
  400 + - mid: "100"
  401 + - cid: "100"
  402 + - unit: "份"
  403 + - name: "测试菜谱"
  404 + - first_name: "测试"
  405 + - search_code: "test"
  406 + - dishSkuList: '[{"no": "000001", "specs": "小份","price": "100.00", "member_price": "55.00" }]'
  407 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  408 + - printid: "1"
  409 + - setup: "1"
  410 + - give: "1"
  411 + - image: "/Users/orange/cover.jpeg"
  412 + - desc: "miaoshu"
  413 + - 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)}
  414 + request:
  415 + url: App.Cookbook.AddCookbook
  416 + method: POST
  417 + headers:
  418 + Content-Type: ${get_content_type($multipart_encoder)}
  419 + data: $multipart_encoder
  420 + validate:
  421 + - eq: ["content.ret", 400]
  422 + - eq: ["content.msg", "非法请求:缺少必要参数status"]
  423 +- test:
  424 + name: 添加菜品信息(不填dishSkuList)
  425 + variable_binds:
  426 + - sellerid: "100"
  427 + - mid: "100"
  428 + - cid: "100"
  429 + - unit: "份"
  430 + - name: "测试菜谱"
  431 + - first_name: "测试"
  432 + - search_code: "test"
  433 + - status: "1"
  434 + - spuAttrList: '[{"name":"辣度","valueList": "微辣"}, {"name":"温度","valueList":"烫"}]'
  435 + - printid: "1"
  436 + - setup: "1"
  437 + - give: "1"
  438 + - image: "/Users/orange/cover.jpeg"
  439 + - desc: "miaoshu"
  440 + - 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)}
  441 + request:
  442 + url: App.Cookbook.AddCookbook
  443 + method: POST
  444 + headers:
  445 + Content-Type: ${get_content_type($multipart_encoder)}
  446 + data: $multipart_encoder
  447 + validate:
  448 + - eq: ["content.ret", 400]
  449 + - eq: ["content.msg", "非法请求:缺少必要参数dishSkuList"]
  450 +
  451 +#删除菜品
  452 +- test:
  453 + name: 删除菜品(删除成功)
  454 + request:
  455 + url: App.Cookbook.DelCookbookById
  456 + method: POST
  457 + data:
  458 + id: 19
  459 + validate:
  460 + - eq: ["content.ret", 200]
  461 +- test:
  462 + name: 删除菜品(不存在的菜品)
  463 + request:
  464 + url: App.Cookbook.DelCookbookById
  465 + method: POST
  466 + data:
  467 + id: 300
  468 + validate:
  469 + - eq: ["content.ret", 394]
  470 + - eq: ["content.msg", "非法请求:删除菜品失败"]
  471 +#修改单个菜品排序
  472 +- test:
  473 + name: 修改单个菜品排序(正确操作)
  474 + request:
  475 + url: App.Cookbook.SetCookbookOrderById
  476 + method: POST
  477 + data:
  478 + id: 19
  479 + order: 10
  480 + validate:
  481 + - eq: ["content.ret", 200]
  482 +- test:
  483 + name: 修改单个菜品排序(相同排序)
  484 + request:
  485 + url: App.Cookbook.SetCookbookOrderById
  486 + method: POST
  487 + data:
  488 + id: 19
  489 + order: 10
  490 + validate:
  491 + - eq: ["content.ret", 398]
  492 + - eq: ["content.msg", "非法请求:修改失败"]
  493 +- test:
  494 + name: 修改单个菜品排序(无效菜品)
  495 + request:
  496 + url: App.Cookbook.SetCookbookOrderById
  497 + method: POST
  498 + data:
  499 + id: 100
  500 + order: 10
  501 + validate:
  502 + - eq: ["content.ret", 398]
  503 + - eq: ["content.msg", "非法请求:修改失败"]
  504 +
  505 +#获取商家下所有菜品
  506 +- test:
  507 + name: 获取商家下所有菜品(按SellerId搜索)
  508 + request:
  509 + url: App.Cookbook.GetCookbookBySellerId
  510 + method: POST
  511 + data:
  512 + page: 1
  513 + SellerId: 4
  514 + validate:
  515 + - eq: ["content.ret", 200]
  516 +- test:
  517 + name: 获取商家下所有菜品(添加CookbookName)
  518 + request:
  519 + url: App.Cookbook.GetCookbookBySellerId
  520 + method: POST
  521 + data:
  522 + page: 1
  523 + SellerId: 4
  524 + CookbookName: "黑醋蛰头"
  525 + validate:
  526 + - eq: ["content.ret", 200]
  527 +- test:
  528 + name: 获取商家下所有菜品(添加ClassId)
  529 + request:
  530 + url: App.Cookbook.GetCookbookBySellerId
  531 + method: POST
  532 + data:
  533 + page: 1
  534 + SellerId: 4
  535 + ClassId: 7
  536 + validate:
  537 + - eq: ["content.ret", 200]
  538 +- test:
  539 + name: 获取商家下所有菜品(添加FirstName)
  540 + request:
  541 + url: App.Cookbook.GetCookbookBySellerId
  542 + method: POST
  543 + data:
  544 + page: 1
  545 + SellerId: 4
  546 + FirstName: "jxnr"
  547 + validate:
  548 + - eq: ["content.ret", 200]
  549 +#获取单个菜品信息
  550 +- test:
  551 + name: 获取单个菜品信息
  552 + request:
  553 + url: App.Cookbook.GetCookbookById
  554 + method: POST
  555 + data:
  556 + id: 2
  557 + validate:
  558 + - eq: ["content.ret", 200]
  559 +
  560 +#修改单个菜品信息
  561 +- test:
  562 + name: 修改单个菜品信息
  563 + request:
  564 + url: App.Cookbook.SetCookbookById
  565 + method: POST
  566 + validate:
  567 + - eq: ["content.ret", 200]
  568 +- test:
  569 + name: 修改单个菜品信息
  570 + request:
  571 + url: App.Cookbook.SetCookbookById
  572 + method: POST
  573 + validate:
  574 + - eq: ["content.ret", 200]
  575 +
  576 +
  577 +
  578 +
  579 +
  580 +
  581 +
  582 +
  583 +
@@ -3,8 +3,7 @@ @@ -3,8 +3,7 @@
3 request: 3 request:
4 base_url: http://dc1.colorcun.com:10005?s= 4 base_url: http://dc1.colorcun.com:10005?s=
5 5
6 - # 添加菜谱失败的情况  
7 - 6 +#添加菜谱
8 - test: 7 - test:
9 name: 添加菜谱(正确操作) 8 name: 添加菜谱(正确操作)
10 variable_binds: 9 variable_binds:
@@ -12,7 +11,7 @@ @@ -12,7 +11,7 @@
12 - sellerid: "15" 11 - sellerid: "15"
13 - status: "1" 12 - status: "1"
14 - image: "/Users/orange/cover.jpeg" 13 - image: "/Users/orange/cover.jpeg"
15 - - multipart_encoder: ${get_menu($name,$sellerid,$status,$image)} 14 + - multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status,image=$image)}
16 request: 15 request:
17 url: App.Menu.AddMenu 16 url: App.Menu.AddMenu
18 method: POST 17 method: POST
@@ -27,7 +26,7 @@ @@ -27,7 +26,7 @@
27 - sellerid: "15" 26 - sellerid: "15"
28 - status: "1" 27 - status: "1"
29 - image: "/Users/orange/cover.jpeg" 28 - image: "/Users/orange/cover.jpeg"
30 - - multipart_encoder: ${get_menu_noname($sellerid,$status,$image)} 29 + - multipart_encoder: ${get_data(sellerid=$sellerid,status=$status,image=$image)}
31 request: 30 request:
32 url: App.Menu.AddMenu 31 url: App.Menu.AddMenu
33 method: POST 32 method: POST
@@ -43,7 +42,7 @@ @@ -43,7 +42,7 @@
43 - name: "菜谱测试1" 42 - name: "菜谱测试1"
44 - status: "1" 43 - status: "1"
45 - image: "/Users/orange/cover.jpeg" 44 - image: "/Users/orange/cover.jpeg"
46 - - multipart_encoder: ${get_menu_noid($name,$status,$image)} 45 + - multipart_encoder: ${get_data(name=$name,status=$status,image=$image)}
47 request: 46 request:
48 url: App.Menu.AddMenu 47 url: App.Menu.AddMenu
49 method: POST 48 method: POST
@@ -59,7 +58,7 @@ @@ -59,7 +58,7 @@
59 - name: "菜谱测试1" 58 - name: "菜谱测试1"
60 - sellerid: "15" 59 - sellerid: "15"
61 - image: "/Users/orange/cover.jpeg" 60 - image: "/Users/orange/cover.jpeg"
62 - - multipart_encoder: ${get_menu_nostatus($name,$sellerid,$image)} 61 + - multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,image=$image)}
63 request: 62 request:
64 url: App.Menu.AddMenu 63 url: App.Menu.AddMenu
65 method: POST 64 method: POST
@@ -75,7 +74,7 @@ @@ -75,7 +74,7 @@
75 - name: "菜谱测试1" 74 - name: "菜谱测试1"
76 - sellerid: "15" 75 - sellerid: "15"
77 - status: "1" 76 - status: "1"
78 - - multipart_encoder: ${get_menu_noimage($name,$sellerid,$status)} 77 + - multipart_encoder: ${get_data(name=$name,sellerid=$sellerid,status=$status)}
79 request: 78 request:
80 url: App.Menu.AddMenu 79 url: App.Menu.AddMenu
81 method: POST 80 method: POST
@@ -86,7 +85,7 @@ @@ -86,7 +85,7 @@
86 - eq: ["content.ret", 400] 85 - eq: ["content.ret", 400]
87 - eq: ["content.msg", "非法请求:缺少上传文件:image"] 86 - eq: ["content.msg", "非法请求:缺少上传文件:image"]
88 87
89 - 88 +#根据菜谱ID获取关联菜品
90 - test: 89 - test:
91 name: 根据菜谱ID获取关联菜品(正确操作) 90 name: 根据菜谱ID获取关联菜品(正确操作)
92 request: 91 request:
@@ -109,7 +108,7 @@ @@ -109,7 +108,7 @@
109 - eq: ["content.msg", "非法请求:暂无关联菜品"] 108 - eq: ["content.msg", "非法请求:暂无关联菜品"]
110 109
111 110
112 - 111 +#根据菜谱ID获取关联菜品数量
113 - test: 112 - test:
114 name: 根据菜谱ID获取关联菜品数量(有关联菜品) 113 name: 根据菜谱ID获取关联菜品数量(有关联菜品)
115 request: 114 request:
@@ -129,7 +128,7 @@ @@ -129,7 +128,7 @@
129 validate: 128 validate:
130 - eq: ["content.ret", 200] 129 - eq: ["content.ret", 200]
131 130
132 - 131 +#根据菜谱ID获取菜谱基本信息
133 - test: 132 - test:
134 name: 根据菜谱ID获取菜谱基本信息(正确操作) 133 name: 根据菜谱ID获取菜谱基本信息(正确操作)
135 request: 134 request:
@@ -151,7 +150,7 @@ @@ -151,7 +150,7 @@
151 - eq: ["content.ret", 400] 150 - eq: ["content.ret", 400]
152 - eq: ["content.msg", "非法请求:暂无菜谱"] 151 - eq: ["content.msg", "非法请求:暂无菜谱"]
153 152
154 - 153 +#根据商家ID获取菜谱信息
155 - test: 154 - test:
156 name: 根据商家ID获取菜谱信息(正确操作) 155 name: 根据商家ID获取菜谱信息(正确操作)
157 request: 156 request:
@@ -172,7 +171,7 @@ @@ -172,7 +171,7 @@
172 - eq: ["content.ret", 400] 171 - eq: ["content.ret", 400]
173 - eq: ["content.msg", "非法请求:暂无菜谱"] 172 - eq: ["content.msg", "非法请求:暂无菜谱"]
174 173
175 - 174 +#根据菜谱ID修改菜谱信息
176 - test: 175 - test:
177 name: 根据菜谱ID修改菜谱信息(正确操作) 176 name: 根据菜谱ID修改菜谱信息(正确操作)
178 variable_binds: 177 variable_binds:
@@ -180,7 +179,7 @@ @@ -180,7 +179,7 @@
180 - name: "菜谱修改1" 179 - name: "菜谱修改1"
181 - status: "1" 180 - status: "1"
182 - image: "/Users/orange/cover.jpeg" 181 - image: "/Users/orange/cover.jpeg"
183 - - multipart_encoder: ${set_menu($id,$name,$status,$image)} 182 + - multipart_encoder: ${get_data(id=$id,name=$name,status=$status,image=$image)}
184 request: 183 request:
185 url: App.Menu.SetMenuById 184 url: App.Menu.SetMenuById
186 method: POST 185 method: POST
@@ -195,7 +194,7 @@ @@ -195,7 +194,7 @@
195 - name: "菜谱修改1" 194 - name: "菜谱修改1"
196 - status: "1" 195 - status: "1"
197 - image: "/Users/orange/cover.jpeg" 196 - image: "/Users/orange/cover.jpeg"
198 - - multipart_encoder: ${set_menu_noid($name,$status,$image)} 197 + - multipart_encoder: ${get_data(name=$name,status=$status,image=$image)}
199 request: 198 request:
200 url: App.Menu.SetMenuById 199 url: App.Menu.SetMenuById
201 method: POST 200 method: POST
@@ -211,7 +210,7 @@ @@ -211,7 +210,7 @@
211 - id: "20" 210 - id: "20"
212 - status: "1" 211 - status: "1"
213 - image: "/Users/orange/cover.jpeg" 212 - image: "/Users/orange/cover.jpeg"
214 - - multipart_encoder: ${set_menu_noname($id,$status,$image)} 213 + - multipart_encoder: ${get_data(id=$id,status=$status,image=$image)}
215 request: 214 request:
216 url: App.Menu.SetMenuById 215 url: App.Menu.SetMenuById
217 method: POST 216 method: POST
@@ -227,7 +226,7 @@ @@ -227,7 +226,7 @@
227 - id: "20" 226 - id: "20"
228 - name: "菜谱修改1" 227 - name: "菜谱修改1"
229 - image: "/Users/orange/cover.jpeg" 228 - image: "/Users/orange/cover.jpeg"
230 - - multipart_encoder: ${set_menu_nostatus($id,$name,$image)} 229 + - multipart_encoder: ${get_data(id=$id,name=$name,image=$image)}
231 request: 230 request:
232 url: App.Menu.SetMenuById 231 url: App.Menu.SetMenuById
233 method: POST 232 method: POST
@@ -243,7 +242,7 @@ @@ -243,7 +242,7 @@
243 - id: "20" 242 - id: "20"
244 - name: "菜谱修改1" 243 - name: "菜谱修改1"
245 - status: "1" 244 - status: "1"
246 - - multipart_encoder: ${set_menu_noimage($id,$name,$status)} 245 + - multipart_encoder: ${get_data(id=$id,name=$name,status=$status)}
247 request: 246 request:
248 url: App.Menu.SetMenuById 247 url: App.Menu.SetMenuById
249 method: POST 248 method: POST
@@ -260,7 +259,7 @@ @@ -260,7 +259,7 @@
260 - name: "菜谱修改1" 259 - name: "菜谱修改1"
261 - status: "1" 260 - status: "1"
262 - image: "/Users/orange/cover.jpeg" 261 - image: "/Users/orange/cover.jpeg"
263 - - multipart_encoder: ${set_menu($id,$name,$status,$image)} 262 + - multipart_encoder: ${get_data(id=$id,name=$name,status=$status,image=$image)}
264 request: 263 request:
265 url: App.Menu.SetMenuById 264 url: App.Menu.SetMenuById
266 method: POST 265 method: POST