Commit 66301938da8b4076d15826ab86d55974d157184c
1 parent
98fa764e
上传演示文档
Showing
2 changed files
with
71 additions
and
0 deletions
commons/api/doAudit.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import requests | |
4 | +import json | |
5 | +import urllib3 | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my | |
8 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
9 | + | |
10 | +class doAudit(): | |
11 | + | |
12 | + url="http://test.trace.diligrp.com:8393/newRegisterBill/doAudit.action?id=5888&verifyStatus=20" | |
13 | + header={ | |
14 | + "Host": "test.trace.diligrp.com", | |
15 | + "Connection": "keep-alive", | |
16 | + "Accept": "application/json,text/javascript,*/*;q=0.01", | |
17 | + "User-Agent": "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36", | |
18 | + "X-Requested-With": "XMLHttpRequest", | |
19 | + "Referer": "http://test.trace.diligrp.com:8393/newRegisterBill/add.html", | |
20 | + "Accept-Encoding": "gzip,deflate", | |
21 | + "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7"} | |
22 | + | |
23 | + | |
24 | + def __init__(self): | |
25 | + self.url=doAudit.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") ) | |
26 | + self.header=doAudit.header | |
27 | + | |
28 | + | |
29 | + | |
30 | + | |
31 | +# tt=doAudit() | |
32 | +# re=my.get(url=tt.url,headers=tt.header) | |
33 | +# print(re.json()) | |
0 | 34 | \ No newline at end of file | ... | ... |
commons/api/fieldConfig.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import requests | |
4 | +import json | |
5 | +import urllib3 | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my | |
8 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
9 | + | |
10 | +class fieldConfig(): | |
11 | + | |
12 | + url="http://test.trace.diligrp.com:8393/fieldConfig/doUpdate.action" | |
13 | + header={ | |
14 | + "Host": "test.trace.diligrp.com:8393", | |
15 | + "Connection": "keep-alive", | |
16 | + "Content-Length": "1378", | |
17 | + "Accept": "application/json,text/javascript,*/*;q=0.01", | |
18 | + "X-Requested-With": "XMLHttpRequest", | |
19 | + "User-Agent": "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/91.0.4472.77Safari/537.36", | |
20 | + "Content-Type": "application/json", | |
21 | + "Origin": "http://test.trace.diligrp.com:8393", | |
22 | + "Referer": "http://test.trace.diligrp.com:8393/fieldConfig/bill.html", | |
23 | + "Accept-Encoding": "gzip,deflate", | |
24 | + "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7"} | |
25 | + | |
26 | + body={"moduleType":"1","marketId":"8","fieldConfigDetailList":[{"fieldName":"unitPrice","jsonPath":"$.unitPrice","defaultId":"3","displayed":"1","required":"0"},{"fieldName":"arrivalTallynos","jsonPath":"$.arrivalTallynos","defaultId":"10","displayed":"1","required":"0"},{"fieldName":"brandName","jsonPath":"$.brandName","defaultId":"5","displayed":"1","required":"0"},{"fieldName":"truckTareWeight","jsonPath":"$.truckTareWeight","defaultId":"1","displayed":"1","required":"0"},{"fieldName":"originId","jsonPath":"$.originId","defaultId":"7","displayed":"1","required":"0"},{"fieldName":"specName","jsonPath":"$.specName","defaultId":"4","displayed":"1","required":"0"},{"fieldName":"truckType","jsonPath":"$.truckType","defaultId":"2","displayed":"1","required":"1","availableValueList":["10","20"]},{"fieldName":"imageCertList","jsonPath":"$.imageCertList[*]certType","defaultId":"11","displayed":"1","required":"0","availableValueList":["2","3"]},{"fieldName":"arrivalDatetime","jsonPath":"$.arrivalDatetime","defaultId":"9","displayed":"1","required":"0"},{"fieldName":"remark","jsonPath":"$.remark","defaultId":"8","displayed":"1","required":"0"},{"fieldName":"remark","jsonPath":"$.remark","defaultId":"6","displayed":"1","required":"0"},{"fieldName":"measureType","jsonPath":"$.measureType","defaultId":"12","displayed":"1","required":"1","availableValueList":["10","20"]}]} | |
27 | + | |
28 | + def __init__(self): | |
29 | + self.url=fieldConfig.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") ) | |
30 | + self.header=fieldConfig.header | |
31 | + self.body=fieldConfig.body | |
32 | + | |
33 | + | |
34 | + | |
35 | + | |
36 | +# tt=fieldConfig() | |
37 | +# re=my.post(url=tt.url,headers=tt.header,json=tt.body) | |
38 | +# print(re.json()) | |
0 | 39 | \ No newline at end of file | ... | ... |