def recongnition_get_camera(self): """业务鉴权接口-获取camera_name和camera_id""" # 1请求头参数 geturl = eval( self.url ) + "/senserealty/platform/v1.0/statistics/summary/camerainfo" join_str_get, ak, sk, tm, nonce = sort() get_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = get_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) querystring = { "store_id": "07e0822ad3", "start_time": "2019-11-24", "end_time": "2019-12-24" } getrequest = self.res.get(url=geturl, headers=headers, params=querystring) print(getrequest.text) print(getrequest.url) return getrequest
def library_configuration_table_update(self): """业务鉴权接口-库配置表-更新人员库""" #1参数组织 puturl = eval(self.url) + "/senserealty/platform/v1.0/confextra" join_str_get, ak, sk, tm, nonce = sort() get_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = get_sign headers["nonce"] = nonce headers["ts"] = tm #2请求参数待参数化 postdata = { 'company_id': "ID1150", "store_id": "07e0822ad3", "ak": "l1-3dd91537-h0eb6c347fb6", "group_name": "test7777666665", "type_id": 1000, "opq_model": "3.0.0" } postrequest = self.res.post(url=puturl, headers=headers, data=json.dumps(postdata)) group_id = postrequest.json()["group_id"] putdata = { 'company_id': "ID1150", "group_id": group_id, "group_name": "test12777777777", "type_id": 1000, "opq_model": "3.0.0" } putrequest = self.res.put(url=puturl, headers=headers, data=json.dumps(putdata)) return putrequest
def recongnition_get_result(self): """业务鉴权接口-识别结果""" # 1请求头参数 geturl = eval(self.url) + "/senserealty/platform/v1.0/trace" join_str_get, ak, sk, tm, nonce = sort() get_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = get_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) start_time = "1577203200" end_time = "1577258779" group_id = "e8b8027ffc" device_id = "30:9c:23:a0:1c:75" limit = 10 geturl = "http://172.30.1.176:11111/senserealty/platform/v1.0/trace?start_time=%s&end_time=%s&group_id=%s&device_id=%s&limit=%s" % ( start_time, end_time, group_id, device_id, limit) print(geturl) self.Trick.setUrl(geturl) getrequest = self.Trick.get(url=geturl, headers=headers) print(getrequest.text) print(getrequest.url) return getrequest
def statistics_person_cameraname(self): """统计功能对外接口-获取camera_name和camera_id""" # 1请求头参数 geturl = eval( self.url ) + "/senserealty/platform/v1.0/statistics/summary/camerainfo" join_str_get, ak, sk, tm, nonce = sort() get_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = get_sign headers["nonce"] = nonce headers["ts"] = tm #2请求参数(待参数化) querysting = { "store_id": "de848b669b", "start_time": "2019-11-23", "end_time": "2019-12-23" } getrequest = self.res.get(url=geturl, headers=headers, params=querysting) print("统计功能对外接口-获取camera_name和camera_id", getrequest.text) print("统计功能对外接口-获取camera_name和camera_id", getrequest.url) return getrequest
def statistics_person_hours(self): """统计功能对外接口-人数统计接口(按小时)""" # 1请求头参数 posturl = eval( self.url) + "/senserealty/platform/v1.0/statistics/summary/hours" join_str_get, ak, sk, tm, nonce = sort() post_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = post_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) postdata = { "store_id": "de848b669b", "start_time": "2019-12-23", "end_time": "2019-12-23", "camera_id": "" } postrequest = self.res.post(url=posturl, headers=headers, data=json.dumps(postdata)) print(postrequest.text) print(postrequest.url) return postrequest
def statistics_person_trace(self): """统计功能对外接口-以图搜图接口""" # 1请求头参数 posturl = eval(self.url) + "/sensego/v2.0/realestate/realestate/trace" join_str_get, ak, sk, tm, nonce = sort() post_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = post_sign headers["nonce"] = nonce headers["ts"] = tm headers["Content-Type"] = "multipart/form-data" # 2请求参数(待参数化) with open("20170508134213.png", "rb") as fp: base64_data = base64.b64encode(fp.read()) print(base64_data) postdata = { "group_id": "de848b669b", "face_image": base64_data, "ak": ak, "sign": post_sign, "nonce": nonce, "ts": tm } postrequest = self.res.get(url=posturl, headers=headers, data=json.dumps(postdata)) print(postrequest.text) print(postrequest.url) return postrequest
def statistics_person_attendance(self): """统计功能对外接口-员工考勤数据统计""" # 1请求头参数 posturl = eval( self.url ) + "/senserealty/platform/v1.0/statistics/summary/staff/attendance" join_str_get, ak, sk, tm, nonce = sort() post_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = post_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) postdata = { "store_id": "de848b669b", "company_id": "ID1150", "start_date": "", "end_date": "2019-12-23" } postrequest = self.res.post(url=posturl, headers=headers, data=json.dumps(postdata)) print("员工考勤数据统计接口:", postrequest.text) print(postrequest.url) return postrequest
def library_configuration_table_get(self): """业务鉴权接口-库配置表-查询store的静态库""" # 1请求头参数 geturl = eval(self.url) + "/senserealty/platform/v1.0/confextra" join_str_get, ak, sk, tm, nonce = sort() get_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = get_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) querystring = {"store_id": "07e0822ad3", "type_id": "-1", "company_id": "ID1150", "group_name": ""} getrequest = self.res.get(url=geturl, headers=headers, params=querystring) return getrequest
def statistics_person_frequencycount(self): """统计功能对外接口-频次统计""" # 1请求头参数 posturl = eval( self.url) + "/senserealty/platform/v1.0/statistics/frequencycount" join_str_get, ak, sk, tm, nonce = sort() post_sign = sign(join_str_get, sk) headers = self.headers headers["ak"] = eval(ak) headers["sign"] = post_sign headers["nonce"] = nonce headers["ts"] = tm # 2请求参数(待参数化) postdata = {"group_id": "de848b669b"} postrequest = self.res.post(url=posturl, headers=headers, data=json.dumps(postdata)) print("员工考勤数据频次统计接口:", postrequest.text) print("员工考勤数据频次统计接口:", postrequest.url) return postrequest