apiDemo.py 1.01 KB
# -*- coding: utf-8 -*-

# @Time    : 2021/8/24 17:15
# @Author  : Ljq
# @File    : apiDemo.py
# @Software: PyCharm

"""

"""

import json,time,random
from commons.scripts import dealContentType as dct
from commons.MySession import my
from commons.basic import getLookupList as gLL

def get_carType(session=None,host="",**kwargs):
    """车型获取"""
    url = host + "/jmsf-web/api/jmsf/query/listCarType"
    data = {"businessCode":"jmsf"}
    headers = dct.jsonCode()
    data = dict(data, **kwargs)
    res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers)
    return res

def get_listCategoryByCondition(session=None,host="",**kwargs):
    """商品获取"""
    url = host + "/assets-service/api/cusCategory/getTree"
    # marketId = my.userInfo()[]
    data = {"marketId":9,"state":1,"keyword":"蔬菜"}
    headers = dct.jsonCode()
    data = dict(data, **kwargs)
    res = session.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers)
    return res