apiDemo.py
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- 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