|
|
|
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 |
...
|
...
|
|