debugtalk.py 9.42 KB
from requests_toolbelt import MultipartEncoder
import requests

def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_content_type(data):
    return data.content_type

def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath):
    m = MultipartEncoder(
        fields={
            'id': sellerid,
            'name': name,
            'phone': phone,
            'map_address': map_address,
            'long': longPoint,
            'lat': latPoint,
            'file': ('file', open(filePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_menu(name,sellerid,status,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'sellerid': sellerid,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_menu_noname(sellerid,status,imagePath):
    m = MultipartEncoder(
        fields={
            'sellerid': sellerid,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_menu_noid(name,status,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_menu_nostatus(name,sellerid,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'sellerid': sellerid,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def get_menu_noimage(name,sellerid,status):
    m = MultipartEncoder(
        fields={
            'name': name,
            'sellerid': sellerid,
            'status': status
        }
    )
    return m
def set_menu(menuid,name,status,imagePath):
    m = MultipartEncoder(
        fields={
            'id': menuid,
            'name': name,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_menu_noid(name,status,imagePath):
    m = MultipartEncoder(
        fields={
            'name': name,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_menu_noname(menuid,status,imagePath):
    m = MultipartEncoder(
        fields={
            'id': menuid,
            'status': status,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_menu_nostatus(menuid,name,imagePath):
    m = MultipartEncoder(
        fields={
            'id': menuid,
            'name': name,
            'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
        }
    )
    return m
def set_menu_noimage(menuid,name,status):
    m = MultipartEncoder(
        fields={
            'id': menuid,
            'name': name,
            'status': status
        }
    )
    return m