def EP_getStationList(pageArg='1', pagesizeArg='20'): method = 'et_common.station.lists' bizContent = {'appid': clientId, 'page': pageArg, 'pagesize': pagesizeArg} data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_adminOpenGate(deviceIdArg, cmdArg): method = 'et_common.device.openAndClose' if cmdArg not in ['open', 'close']: return statusCode.checkSubCode('F', 'cmdArg error') bizContent = {"appid": clientId, "cmd": cmdArg, "device_id": deviceIdArg} data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_delInviteCar(stationIdArg, authorizeIdArg): method = 'et_common.authorize.del' bizContent = { "appid": clientId, "station_id": stationIdArg, "authorize_id": authorizeIdArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_recoverContractPlate(stationIdArg, plateArg): method = 'et_common.contract.recover' bizContent = { "appid": clientId, "station_id": stationIdArg, "plate": plateArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_setGateOpen(stationIdArg, plateArg, code): method = 'et_common.car.open' bizContent = { "appid": clientId, "station_id": stationIdArg, "plate": plateArg, "code": code } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_getGateList(stationIdArg, directionArg='in'): method = 'et_common.device.lists' if directionArg not in ['in', 'out']: return statusCode.checkSubCode('F', 'directionArg error') bizContent = { 'appid': clientId, 'station_id': stationIdArg, 'dicretion': directionArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_askGateOpen(stationIdArg, plateArg, typeArg='in'): method = 'et_common.car.askopen' if typeArg not in ['in', 'out']: return statusCode.checkSubCode('F', 'typeArg error') bizContent = { "appid": clientId, "station_id": stationIdArg, "plate": plateArg, "type": typeArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_setInviteCar(stationIdArg, starttimeArg, stoptimeArg, clientIdArg, plateArg): method = 'et_common.authorize.bespeak' # 这里少了时间格式验证,以后补上 bizContent = { "appid": clientId, "station_id": stationIdArg, "plate": plateArg, "starttime": starttimeArg, "stoptime": stoptimeArg, "client_id": clientIdArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_getContractList(stationIdArg, plateArg='#', pageArg='1', pagesizeArg='20'): method = 'et_common.contract.lists' bizContent = { 'appid': clientId, 'station_id': stationIdArg, 'page': pageArg, 'pagesize': pagesizeArg } if plateArg != '#': bizContent['plate'] = plateArg data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_TBD(departureIdArg, arrivalIdArg, deviceIdArg, timeArg, memberArg, carIdArg, plateArg, eventArg, stationIdArg, stationNameArg): method = '#' bizContent = { 'departure_id': departureIdArg, 'arrival_id': arrivalIdArg, 'device_id': deviceIdArg, 'time': timeArg, 'member': memberArg, 'car_id': carIdArg, 'plate': plateArg, 'event': eventArg, 'station_id': stationIdArg, 'station_name': stationNameArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)
def EP_getCarImage(stationIdArg, typeArg, idArg, dateArg=str( time.strftime('%Y%m', time.localtime(time.time())))): method = 'et_common.inout.images' if typeArg not in ['in', 'out']: return statusCode.checkSubCode('F', 'typeArg error') if type(dateArg) != str and len(dateArg) != 6: return statusCode.checkSubCode('F', 'dateArg error') bizContent = { "appid": clientId, "station_id": stationIdArg, 'type': typeArg, "id": idArg, 'date': dateArg } data = EP_API_Base(method, bizContent) dataContent = data['statusBaseContent'] if data["statusBaseCode"] == 0: return statusCode.checkSubCode('T', dataContent) return statusCode.checkSubCode('F', dataContent)