apiDemo.py 1.02 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,sessionHeb
from commons.basic import getLookupList as gLL

global mk_sign
mk_sign = "haaab"

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

def get_listCategoryByCondition(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 = my.useHeadersRequests(method="POST", url=url, data=json.dumps(data), headers=headers)
    return res