示例#1
0
    def __init__(self, service, senddata):

        self.service = service
        self.senddata = senddata
        # 请求地址
        self.url = "http://192.168.8.21/service"
        # 请求参数
        self.publicdata = {
            "buildVersion": "100",
            "device": "phpService",
            "partnerId": "20170315123001000001",
            "protocol": "httpPost",
            # "service": "o2oQuerySysMessagePageList",
            "signType": "MD5",
            "systemVersion": "7.1",
            "version": "1.0",
            "appName": "o2o_user_wx_app",
            "deviceId": "test111",
            "system": "python3",
            "orderNo": str(uuid.uuid4()),
            "publicKey": "51face7d5d52497016e7865c052ac051"
        }
        self.publicdata["service"] = self.service
        # 添加私有参数
        for k, v in self.senddata.items():
            self.publicdata[k] = v
        # 生成sign
        self.sign = buApiBase().getSign(buApiBase().data2strforilife(
            self.publicdata))
        self.publicdata["sign"] = self.sign
        del self.publicdata["publicKey"]
示例#2
0
    def __init__(self, service, secdata):

        self.service = service
        # self.url = "http://192.168.8.21:6880/tasker"  # 内网开发环境
        # self.url = "https://********.com"   # 正式环境
        # self.url = "http://**********"  # 新正式环境
        self.url = "http://192.168.8.18:6881"  # 新自测环境
        # self.url = "http://192.168.8.35:6881"  # 新集成环境

        # 公共参数
        self.pubdata = {
            "terraceId": "****************",  # i生活
            # "terraceId": "****************",  # 长青
            "secret": "****************",  # i生活
            # "secret": "****************",  # 长青
            "signType": "MD5",
            "version": "v1.0",
            "device": "ANDROID"
        }
        # 添加私有参数
        for k, v in secdata.items():
            self.pubdata[k] = v

        self.datastr = buApiBase().data2str(self.pubdata)
        # print(self.datastr)
        self.cpdatastr = copy.deepcopy(self.pubdata)  #深度拷贝合并后的参数字典
        del self.cpdatastr["secret"]  #删除secret
        self.senddata = buApiBase().data2str(
            self.cpdatastr) + "&" + "sign" + "=" + buApiBase().getSign(
                self.datastr)
示例#3
0
 def test_assertFlow(self):
     """BU流水查询"""
     self.service = "/wallet/v1/assertFlow"
     self.tdtime = "2018-06-22 10:22:22"
     self.dtime = buApiBase().time2Timestamps(self.tdtime)  # 指定时间转换为毫秒时间戳
     # self.dtime = buApiBase().nowtime2Timestamps()
     self.secdata = {"token": self.token,
                     "flag": "0",
                     "dateFlag": "0",
                     "unixTimestamp": self.dtime,
                     "page": "1",
                     "pageSize": "40"}
     r = request2buApi(self.service, self.secdata).send()