def login_in(self, mobile): # 登录 url = 'http://118.178.242.96:8371/FffdAppServer/user/login.rest' # 登录验证 请求参数 "mobile": "15921135537","verifyCode": "2345" logging.info('current url is %s' % url) api = Login_in() api.send_verifcode(mobile) # 发送验证码 db = DB() yanzhnegma = db.get_YanZhengMa(mobile) # 获取验证码 logging.info('yanZhengMa is %s ' % yanzhnegma) dict1 = {'mobile': mobile, 'verifyCode': yanzhnegma} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] # 获取请求头头信息 logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json()) data_content = response.json() ticket = data_content['data']['ticket'] # 获取ticket userID = data_content['data']['userId'] # 获取userId hximUserId = data_content['data']['hximUserId'] virtualPhone = data_content['data']['virtualPhone'] # 获取小号 self.token = ticket # 获取ticket self.userID = userID # 获取用户id self.virtualPhone = virtualPhone # 获取小号 print(self.token) return ticket, userID, hximUserId, virtualPhone
def houseDetail(self, n): #参数为房间id #41获取房间详情 ''' :param n: 房间id :return: 门锁电量,门锁id,门锁联网状态,门锁联网信号 ''' url = 'http://118.178.242.96:8371/FffdAppServer/house/houseDetail.rest' #//房源列表中的id bizType;//房源列表中的bizType 1出租,2出售 logging.info('current url is %s' % url) dict1 = {"id": n, "bizType": 1} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) result1 = response.json() doorInfo = result1['data']['house'] #获取门锁消息 if doorInfo != None: dianliang = doorInfo['doorLockInfo']['electric'] #获取门锁电量 doorId = doorInfo['doorLockInfo']['id'] #获取门锁id zhuangyai = doorInfo['doorLockInfo']['success'] #门锁联网状态 xinhao = doorInfo['doorLockInfo']['rssi'] #门锁联网信号 fangjian = doorInfo['roomNoStr'] logging.info('房间号是%s 的门锁id为%s,联网状态为%s,电量值为%s,' % (n, doorId, zhuangyai, dianliang)) return dianliang, doorId, zhuangyai, xinhao, fangjian else: logging.info('房间号是%s 的房间还没有装门锁!' % self.rentId[n]) print(response.json())
def myHouseList1(self): #获取房源列表 header 需要加入'u_ticket'字段 url = 'http://118.178.242.96:8371/FffdAppServer/house/myHouseList.rest' #发房小区列表搜索 请求参数{"pageSize":20,"offset":0} logging.info('current url is %s' % url) dict1 = { "pageSize": 20, "offset": 0, } json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response1 = requests.post(url, headers=header, data=json_dict) content = response1.json() try: houseId = content['data']['rows'] #print(houseId) for result in houseId: #print(result['id'])#获取房源ID if result['id'] != None and result[ 'jointRentRoomModelList'] != None: self.houseRoom.append(result['id']) #获取有房间的房源 logging.info('有房间的房源为%s' % self.houseRoom) finally: print(content) return content, self.houseRoom
def getJointRentHouseDetail(self, houseId): #n参数为了获取houseId # 71获取合租房子详情 请求参数{“houseId”:111} url = 'http://118.178.242.96:8371/FffdAppServer/house/getJointRentHouseDetail.rest' #71获取合租房子详情 请求参数{"houseId":111} houseId;//房子id(我的房子列表中的id) logging.info('current url is %s' % url) dict1 = {"houseId": houseId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) content = response.json() houseStatus = content['data']['houseModel'] status = re.compile("\'houseStatus\':(.*?),") status = status.findall(str(houseStatus))[0] status = int(status) if status == 1: a = '待审核(未申请装锁)' print('房源id为 %s 的门锁安装状态是 %s!' % (houseId, a)) elif status == 2: a = '审核中' print('房源id为 %s 的门锁安装状态是 %s!' % (houseId, a)) elif status == 3: a = '待装锁' print('房源id为 %s 的门锁安装状态是 %s!' % (houseId, a)) elif status == 4: a = '已装锁' print('房源id为 %s 的门锁安装状态是 %s!' % (houseId, a)) else: print('') print(response.json()) return response.json(), response.status_code
def request_(self, url, loc): json_dict = json.dumps(loc, ensure_ascii=False) A = Paixu() B = A.get_canshu('pingguo', loc) header = B[1] header['u_ticket'] = self.token response = requests.post(url, header=header, data=json_dict) return response
def getConfigInfo(self): #142、获取当前配置信息 url = 'http://118.178.242.96:8371/FffdAppServer/system/getConfigInfo.rest' dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def removeHouse(self, houseId): #136、删除房屋(v1.3新增) url = 'http://118.178.242.96:8371/FffdAppServer/house/removeHouse.rest' dict1 = {"houseId": houseId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def openDoor(self, doorId): #131、一键开门(v1.1新增) url = 'http://118.178.242.96:8371/FffdAppServer/door/openDoor.rest' dict1 = {"doorId": doorId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getOrderList(self): # 176、房东年付订单列表[v1.3新增] url = 'http://118.178.242.96:8371/FffdAppServer/fdnf/getOrderList.rest' dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def terminateRentContract(self, n): #终止合同 url = "http://118.178.242.96:8371/FffdAppServer/contract/terminateRentContract.rest" #104、终止租赁合同 请求参数{"contractId":111} logging.info('current url is %s' % url) dict1 = {"contractId": self.contractId[n]} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) requests.post(url, headers=header, data=json_dict) logging.info('ID为%s的合同解约成功' % n)
def rentHouseList4ff(self): # 162、获取待发布一楼租房列表 <V1.3新增> url = 'http://118.178.242.96:8371/FffdAppServer/house/rentHouseList4ff.rest' dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def h5_urls(self): #61、获取H5对应的路径 > url = 'http://118.178.242.96:8371/FffdAppServer/develop/h5_urls.rest' logging.info('current url is %s' % url) dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def account_reg_check(self, regJobId): #渠道平台账户注册检查 url = 'http://118.178.242.96:8371/FffdAppServer/channel/account_reg_check.rest' logging.info('current url is %s' % url) dict1 = {"regJobId": regJobId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def delAssistant(self, userId): # 171、删除助理账号 v1.3新增 > # 请求参数{"userId":1} url = 'http://118.178.242.96:8371/FffdAppServer/user/delAssistant.rest' dict1 = {"userId": userId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def addAssistant(self, name, mobile): # 170、添加助理账号 v1.3新增 > # 请求参数{}"name":"姓名","mobile":"手机号" url = 'http://118.178.242.96:8371/FffdAppServer/user/addAssistant.rest' dict1 = {"name": name, "mobile": mobile} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getEContractInfo(self, contractId): #101、获取租赁电子合同详情 > url = 'http://118.178.242.96:8371/FffdAppServer/contract/getEContractInfo.rest' logging.info('current url is %s' % url) dict1 = {"contractId": contractId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def downHouse(self, id): #同步下架房源 请求参数{"id":20,"bizType":1,"channelTagListStr":"1,2,3"} id;//房源列表中的id bizType;//1出租,2出售 channelTagListStr;//渠道标识:1、百姓网,2、安居客,3、房多多 url = 'http://118.178.242.96:8371/FffdAppServer/house/downHouse.rest' logging.info('current url is %s' % url) dict1 = {"id": id, "bizType": 1, "channelTagListStr": "1,2,3"} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def addEstateFeedback(self, memo): #134、新增小区问题反馈 # 请求参数{"memo":" 问题描述","imgKeyStr":"图片,逗号隔开"} url = 'http://118.178.242.96:8371/FffdAppServer/door/addEstateFeedback.rest' dict1 = {"memo": memo} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getBuildingInfo(self, subEstateId): #subEstateId//子划分id #获取子划分楼栋号列表 url = 'http://118.178.242.96:8371/FffdAppServer/house/getBuildingInfo.rest' logging.info('current url is %s' % url) dict1 = {"subEstateId": subEstateId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def checkIdentity(self, idCard): # 146、校验身份证(v1.1新增) # 请求参数{ "idCard":"320xxx",} url = 'http://118.178.242.96:8371/FffdAppServer/system/getConfigInfo.rest' dict1 = {"idCard": idCard} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getAllBillLivingTypes(self): #115、查询所有生活账单类型 > url = 'http://118.178.242.96:8371/FffdAppServer/bill/getAllBillLivingTypes.restt' logging.info('current url is %s' % url) dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def markBillPaid(self, billId): #114、标记账单为已支付 v1.3新增 > url = 'http://118.178.242.96:8371/FffdAppServer/bill/getRentBillDetail.rest' logging.info('current url is %s' % url) dict1 = {"billId": billId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def listRentBill(self, a, b): #110、获取租赁账单列表 请求参数{"contractId":111,"rentId":111,"pageNo":1,"pageSize":20}# #rentId出租id url = 'http://118.178.242.96:8371/FffdAppServer/bill/listRentBill.rest' logging.info('current url is %s' % url) dict1 = {"contractId": a, 'rentId': b, "pageNo": 1, "pageSize": 20} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getVirtualMobileInfo(self, userID): #获取小号详情 请求参数{"userId ": 1} url = 'http://118.178.242.96:8371/FffdAppServer/user/getVirtualMobileInfo.rest' logging.info('current url is %s' % url) dict1 = {"userId": userID} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def getMyInfo(self): #获取"我的"信息 url = 'http://118.178.242.96:8371/FffdAppServer/userContact/getMyInfo.rest' logging.info('current url is %s' % url) dict1 = {"": ""} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def publishRentHouseToff(self, rentIds): # 163、发布到一楼租房 <V1.3新增> # 请求参数{"rentIds":"1,2,3",} url = 'http://118.178.242.96:8371/FffdAppServer/house/publishRentHouseToff.rest' dict1 = {"rentIds": rentIds} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def publish_joint_rent_house(self, c): # 55、发布合租房子信息[v1.4修改] url = 'http://118.178.242.96:8371/FffdAppServer/house/publish_joint_rent_house.rest' logging.info('current url is %s' % url) dict1 = {c} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def checkUserPerms(self, B): #143、检查用户是否有门锁权限(v1.1新增) #请求参数{"houseId":用于查找大门,非必填,"rentId":房间ID} url = 'http://118.178.242.96:8371/FffdAppServer/system/getConfigInfo.rest' dict1 = {B} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, 'pingguo') header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def allot_xphone(self, bizType, id, channelTag): # 160、分配渠道小号 [v1.3新增] # 请求参数{"bizType":1、出租;2、出售, "id":"出售ID或出租ID","channelTag":"1百姓网 2安居客 3房多多 4赶集 5豆瓣 6五八 7爱屋吉屋 8嗨住 9一楼租房"} url = 'http://118.178.242.96:8371/FffdAppServer/user/allot_xphone.rest' dict1 = {"bizType": bizType, "id": id, "channelTag": channelTag} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())
def channel_group_list(self, bizType, houseRentId): # 161、获得房源同步平台情况 小号分组详情 [v1.3新增] # 请求参数{"bizType":1、出租;2、出售, "houseRentId":"出租ID",} url = 'http://118.178.242.96:8371/FffdAppServer/user/allot_xphone.rest' dict1 = {"bizType": bizType, "houseRentId": houseRentId} json_dict = json.dumps(dict1, ensure_ascii=False) A = Paixu() B = A.get_canshu(dict1, A.pingguo) header = B[1] header['u_ticket'] = self.token logging.info("now header is %s" % header) response = requests.post(url, headers=header, data=json_dict) print(response.json())