import 'dart:convert'; import 'package:get/get.dart'; import 'api_provider_base.dart'; class ApiProvider extends BaseProvider { Future getVerificationCode(String countryCode, String account, String channel, String codeType, String uniqueid, String xWidth) => post( getVerificationCodeUrl.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, "channel": channel, 'codeType': codeType, "uniqueid": uniqueid, 'xWidth': xWidth, })); Future register(String countryCode, String countryId, String mobile, String password, String uniqueid, String verificationCode) => post(registerUrl.toUrl, null, query: { 'countryCode': countryCode, 'countryId': countryId, "mobile": mobile, 'password': password, 'platId': "2", "uniqueid": uniqueid, 'verificationCode': verificationCode, }); // post( // registerUrl.toUrl, // jsonEncode({ // 'countryCode': countryCode, // 'countryId': countryId, // "mobile": mobile, // 'password': password, // 'platId': "2", // "uniqueid": uniqueid, // 'verificationCode': verificationCode, // })); Future getSliderVerifyImg(String countryCode, String account) => post( getSliderVerifyImgUrl.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, })); Future checkSliderVerifyImg( String countryCode, String account, String xWidth) => post( checkImgUrl.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, 'xWidth': xWidth, })); Future login(String loginType, String password, String countryCode, String username) => post( loginUrl.toUrl, jsonEncode({ 'loginType': loginType, 'password': password, "platId": "2", 'uniqueid': "477E6814-289D-402A-9F49-F89A8BD05D63", 'countryCode': countryCode, "username": username })); Future resetPassword( String countryCode, String account, String date, String newPassword, String uniqueid, String verificationCode) => post( resetPasswordURL.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, "date": date, 'newPassword': newPassword, "uniqueid": uniqueid, 'verificationCode': verificationCode, })); Future getCountryRegion(String type) => post(getCountryRegionURL.toUrl, jsonEncode({'type': type})); Future electronicKeyList( String endDate, String keyId, String keyStatus, String lockId, String operatorUid, String pageNo, String pageSize, String startDate, String keyRight, String searchStr) => post( electronicKeyListURL.toUrl, jsonEncode({ 'endDate': endDate, 'keyId': keyId, "keyStatus": keyStatus, 'lockId': lockId, "operatorUid": operatorUid, 'pageNo': pageNo, 'pageSize': pageSize, 'startDate': startDate, 'keyRight': keyRight, 'searchStr': searchStr })); Future sendElectronicKey( String createUser, String countryCode, String usernameType, String endDate, String faceAuthentication, String isCameraEnable, String isRemoteUnlock, String keyNameForAdmin, String keyRight, String keyType, String lockId, String operatorUid, String receiverUsername, String remarks, String startDate, List weekDays) => post( sendElectronicKeyURL.toUrl, jsonEncode({ 'createUser': createUser, 'countryCode': countryCode, 'usernameType': usernameType, 'endDate': endDate, 'faceAuthentication': faceAuthentication, 'isCameraEnable': isCameraEnable, 'isRemoteUnlock': isRemoteUnlock, 'keyNameForAdmin': keyNameForAdmin, 'keyRight': keyRight, 'keyType': keyType, 'lockId': lockId, 'operatorUid': operatorUid, 'receiverUsername': receiverUsername, 'remarks': remarks, 'startDate': startDate, 'weekDays': weekDays })); Future uploadElectricQuantity( String electricQuantity, String lockId, ) => post( uploadElectricQuantityURL.toUrl, jsonEncode({ 'electricQuantity': electricQuantity, 'lockId': lockId, })); Future modifyKeyName( String keyId, String lockId, String keyName, ) => post( modifyKeyNameURL.toUrl, jsonEncode({ 'keyId': keyId, 'lockId': lockId, 'keyName': keyName, })); Future modifyKeyNameForAdmin( String keyId, String keyNameForAdmin, String operatorUid, ) => post( modifyKeyNameForAdminURL.toUrl, jsonEncode({ 'keyId': keyId, 'keyNameForAdmin': keyNameForAdmin, 'operatorUid': operatorUid, })); Future updateKeyDate( String keyId, String lockId, String endDate, String endDay, String operatorUid, String startDate, String startDay, List weekDays) => post( updateKeyDateURL.toUrl, jsonEncode({ 'keyId': keyId, 'lockId': lockId, 'endDate': endDate, 'endDay': endDay, 'operatorUid': operatorUid, 'startDate': startDate, 'startDay': startDay, 'weekDays': weekDays, })); Future resetElectronicKey(String lockId, String operatorUid) => post(resetElectronicKeyURL.toUrl, jsonEncode({'lockId': lockId, 'operatorUid': operatorUid})); Future lockRecordList( String endDate, String keyId, String keyStatus, String lockId, String operatorUid, String pageNo, String pageSize, String startDate, String recordType, String searchStr, String timezoneRawOffSet, String keyboardPwdId, String cardId, String fingerprintId) => post( keyOperationRecordURL.toUrl, jsonEncode({ 'endDate': endDate, 'keyId': keyId, "keyStatus": keyStatus, 'lockId': lockId, "operatorUid": operatorUid, 'pageNo': pageNo, 'pageSize': pageSize, 'startDate': startDate, 'recordType': recordType, 'searchStr': searchStr, 'timezoneRawOffSet': timezoneRawOffSet, 'keyboardPwdId': keyboardPwdId, 'cardId': cardId, 'fingerprintId': fingerprintId })); // 锁记录上传 Future lockRecordUploadData(String lockId, List records) => post( lockRecordUploadURL.toUrl, jsonEncode({ 'lockId': lockId, 'records': records, }), isUnShowLoading: true); // 查询锁记录最后时间 Future getLockRecordLastUploadDataTime(String lockId) => post( getLockRecordLastUploadDataTimeURL.toUrl, jsonEncode({ 'lockId': lockId, }), isUnShowLoading: true); // 获取手机联网token Future getLockNetToken(String lockId) => post( getLockNetTokenURL.toUrl, jsonEncode({ 'lockId': lockId, }), isUnShowLoading: true); // 更新锁用户NO Future updateLockUserNo(String keyId, String lockUserNo) => post( updateLockUserNoURL.toUrl, jsonEncode({ 'keyId': keyId, 'lockUserNo': lockUserNo, }), isUnShowLoading: true); // 绑定蓝牙管理员 Future bindingBlueAdmin( String lockAlias, Map position, Map bluetooth, Map lockInfo, String lockUserNo, String pwdTimestamp, String featureValue, String featureSettingValue, List featureSettingParams) => post( bindingBlueAdminURL.toUrl, jsonEncode({ "lockAlias": lockAlias, 'position': position, 'bluetooth': bluetooth, 'lockInfo': lockInfo, 'lockUserNo': lockUserNo, 'pwdTimestamp': pwdTimestamp, 'featureValue': featureValue, 'featureSettingValue': featureSettingValue, 'featureSettingParams': featureSettingParams, })); // 获取锁信息 Future getLockInfo(String lastUpdateDate, String pageNo) => post( getLockInfoURL.toUrl, jsonEncode({ 'lastUpdateDate': lastUpdateDate, "pageNo": pageNo, })); // 获取锁信息列表 Future getStarLockListInfo(int pageNo, int pageSize) => post( getStarLockInfoURL.toUrl, jsonEncode({ "pageNo": pageNo, 'pageSize': pageSize, })); // 获取所有锁设置信息 Future getLockSettingInfoData(String lockId) => post( getLockSettingURL.toUrl, jsonEncode({ 'lockId': lockId, })); // 删除锁 Future deletLockInfo(String lockId) => post( deletLockURL.toUrl, jsonEncode({ 'lockId': lockId, })); // 删除拥有的当前钥匙 Future deletOwnerKeyInfo(String lockId, String keyId) => post( deleteElectronicKeyURL.toUrl, jsonEncode({'lockId': lockId, 'keyId': keyId})); // 检查账户密码 Future checkLoginPassword(String password) => post( checkPasswordURL.toUrl, jsonEncode({ 'password': password, })); // 获取Wifi锁服务器 Future getWifiLockServiceIpAndPort() => post(getWifiServiceIpURL.toUrl, jsonEncode({})); Future passwordKeyList(String keyStatus, String lockId, String pageNo, String pageSize, String searchStr) => post( passwordKeyListURL.toUrl, jsonEncode({ 'keyStatus': keyStatus, 'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr })); Future resetPasswordKey(String lockId, String operatorUid) => post( resetPasswordURL.toUrl, jsonEncode({'lockId': lockId, 'operatorUid': operatorUid})); Future getKeyboardPwd( String endDate, String isExclusive, String keyboardPwdName, String keyboardPwdType, String keyboardPwdVersion, String lockId, String operatorUid, String startDate, String timezoneRawOffSet, int startHours, int endHours, int isCoerced) => post( passwordKeyGetURL.toUrl, jsonEncode({ 'endDate': endDate, 'isExclusive': isExclusive, 'keyboardPwdName': keyboardPwdName, 'keyboardPwdType': keyboardPwdType, 'keyboardPwdVersion': keyboardPwdVersion, 'lockId': lockId, 'operatorUid': operatorUid, 'startDate': startDate, 'timezoneRawOffSet': timezoneRawOffSet, 'hoursStart': startHours, 'hoursEnd': endHours, 'isCoerced': isCoerced, })); Future addKeyboardPwd( String lockId, String keyboardPwdName, String keyboardPwd, String keyboardPwdType, String startDate, String endDate, String addType, ) => post( passwordKeyAddURL.toUrl, jsonEncode({ 'lockId': lockId, 'keyboardPwdName': keyboardPwdName, 'keyboardPwd': keyboardPwd, 'keyboardPwdType': keyboardPwdType, 'startDate': startDate, 'endDate': endDate, 'addType': addType, })); Future updateKeyboardPwd( int lockId, String keyboardPwdId, String keyboardPwdName, String newKeyboardPwd, int startDate, int endDate, String changeType, String isCoerced, int hoursStart, int hoursEnd) => post( updatePasswordKeyURL.toUrl, jsonEncode({ 'lockId': lockId, 'keyboardPwdId': keyboardPwdId, 'keyboardPwdName': keyboardPwdName, 'newKeyboardPwd': newKeyboardPwd, 'startDate': startDate, 'endDate': endDate, 'changeType': changeType, 'isCoerced': isCoerced, 'hoursStart': hoursStart, 'hoursEnd': hoursEnd })); Future clearOperationRecord(String lockId) => post(clearOperationRecordURL.toUrl, jsonEncode({'lockId': lockId})); Future addLockGroup(String groupName, String operatorUid) => post( addlockGroupURL.toUrl, jsonEncode({'groupName': groupName, 'operatorUid': operatorUid})); // 编辑锁名字 Future editLockGroupRequest(int groupId, String groupName) => post( editlockGroupURL.toUrl, jsonEncode({'groupId': groupId, 'groupName': groupName})); Future setLockGroup(String lockId, String groupId) => post( setlockGroupURL.toUrl, jsonEncode({'lockId': lockId, 'groupId': groupId})); Future lockGroupList(String type) => post(lockGroupListURL.toUrl, jsonEncode({'type': type})); // 删除组 Future deleteGroup(int groupId) => post( lockDeletGroupURL.toUrl, jsonEncode({ 'groupId': groupId, })); // 锁分组里面添加锁 Future lockGroupAddLock(List lockIds, int groupId) => post( lockGroupAddLockURL.toUrl, jsonEncode({ 'lockId': lockIds, 'groupId': groupId, })); // 锁分组里面删除锁 Future lockGroupDeletLock(List lockIds) => post( lockGroupDeletLockURL.toUrl, jsonEncode({ 'lockId': lockIds, })); Future selectLockList() => post(selectLockListURL.toUrl, jsonEncode({})); //APP开锁时需手机联网的锁 Future setAppUnlockMustOnline(List lockIdList) => post( setAppUnlockMustOnlineURL.toUrl, jsonEncode({'lockIdList': lockIdList})); Future deleteElectronicKey(String keyId) => post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId})); Future deleteAdministrator(String uid, String includeUnderlings) => post(deleteElectronicKeyURL.toUrl, jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings})); Future updateAdministrator(String uid, String keyName, String endDate, String startDate, String remoteEnable) => post( updateAdministratorURL.toUrl, jsonEncode({ 'uid': uid, 'keyName': keyName, 'endDate': endDate, 'startDate': startDate, 'remoteEnable': remoteEnable })); Future expireLockList( String operatorUid, String pageNo, String pageSize) => post( expireLockListURL.toUrl, jsonEncode({ 'operatorUid': operatorUid, 'pageNo': pageNo, 'pageSize': pageSize, })); Future deleteKeyboardPwd( String lockId, String keyboardPwdId, int deleteType) => post( deleteKeyboardPwdURL.toUrl, jsonEncode({ 'lockId': lockId, 'keyboardPwdId': keyboardPwdId, 'deleteType': deleteType })); // Future updateSetting(String lockId, String isOn, String type) => // post(updateSettingURL.toUrl, // jsonEncode({'lockId': lockId, 'isOn': isOn, 'type': type})); // Future keyGroupList(String type) => // post(keyGroupListURL.toUrl, jsonEncode({'type': type})); // // Future lockListByGroup(String type, String keyGroupId) => post( // lockListByGroupURL.toUrl, // jsonEncode({'type': type, 'keyGroupId': keyGroupId})); /// 锁设置模块 // 自动闭锁 Future setAutoUnlockLoadData( int lockId, int autoLock, int autoLockSecond) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'autoLock': autoLock, 'autoLockSecond': autoLockSecond, })); // 锁声音 Future setLockSoundData( int lockId, int lockSound, int lockSoundVolume) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'lockSound': lockSound, 'lockSoundVolume': lockSoundVolume, })); // 防撬报警 Future setBurglarAlarmData(int lockId, int antiPrySwitch) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'antiPrySwitch': antiPrySwitch, })); // 开门方向 Future setOpenDoorDirectionData( int lockId, int openDirectionValue) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'openDirectionValue': openDirectionValue, })); // 远程开锁 Future remoteUnlockingOpenOrCloseLoadData( int lockId, int remoteUnlock) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'remoteUnlock': remoteUnlock, })); // 重置键 Future setResetButtonData(int lockId, int resetSwitch) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'resetSwitch': resetSwitch, })); // 设置考勤 Future setCheckInData(int lockId, int resetSwitch) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'attendance': resetSwitch, })); // 设置开锁时是否需联网 Future setOpenLockNeedOnlineData(int lockId, int appUnlockOnline) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'appUnlockOnline': appUnlockOnline, })); // 设置标记房态 Future setRoomStatusData(int lockId, int roomStatus) => post( setRoomStatusURL.toUrl, jsonEncode({ 'lockId': lockId, 'roomStatus': roomStatus, })); // 设置常开模式 Future setNormallyModeData( int lockId, int passageMode, List passageModeConfig) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'passageMode': passageMode, 'passageModeConfig': passageModeConfig, })); // 通过网关获取锁的时间 Future getLockTimeFromGatewayLoadData(String lockId) => post( roomQueryDateUrl.toUrl, jsonEncode({ 'lockId': lockId, })); // 设置管理员开锁密码 Future setAdminPasswordData(int lockId, String adminPwd) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'adminPwd': adminPwd, })); // 获取服务器当前时间 Future getServerDatetimeLoadData(String lockId) => post( getServerDatetimeUrl.toUrl, jsonEncode({ 'lockId': lockId, })); // 锁诊断 Future setLockDiagnoseData( String lockId, String electricQuantity, String firmwareRevision, String hardwareRevision, String lockDate, String modelNum, String pwdInfo, String timestamp) => post( lockDiagnoseUrl.toUrl, jsonEncode({ 'lockId': lockId, 'electricQuantity': electricQuantity, 'firmwareRevision': firmwareRevision, 'hardwareRevision': hardwareRevision, 'lockDate': lockDate, 'modelNum': modelNum, 'pwdInfo': pwdInfo, 'timestamp': timestamp, })); // 获取锁版本信息 Future getLockVersionInfoLoadData(String lockId) => post( getLockVersionInfoUrl.toUrl, jsonEncode({ 'lockId': lockId, })); Future updateLockName( String lockId, String lockName, ) => post( updateLockNameURL.toUrl, jsonEncode({ 'lockId': lockId, 'lockName': lockName, })); // 开启考勤获取考勤信息 Future openCheckingInGetData(String lockId) => post( openCheckingInURL.toUrl, jsonEncode({ 'lockId': lockId, }), isUnShowLoading: true); // 设置考勤时创建公司 Future setCheckInCreateCompanyData( String lockId, String attendanceType, String companyName, List workDay, String workEndTime, String workStartTime) => post( setCheckInCreateCompanyURL.toUrl, jsonEncode({ 'lockId': lockId, 'attendanceType': attendanceType, 'companyName': companyName, 'workDay': workDay, 'workEndTime': workEndTime, 'workStartTime': workStartTime, })); // 删除公司 Future deletCompanyData(int companyId) => post( deleteCompanyURL.toUrl, jsonEncode({ 'companyId': companyId, }), isUnShowLoading: true); // 获取开锁提醒 Future setLockPickingReminderData( int lockId, int unlockReminderPush) => post( updateLockSettingUrl.toUrl, jsonEncode({ 'lockId': lockId, 'unlockReminderPush': unlockReminderPush, })); // 获取员工列表 Future getStaffListData(String companyId, String lockId) => post( getStaffListURL.toUrl, jsonEncode({ 'companyId': companyId, 'lockId': lockId, })); // 添加员工 Future addStaffData( String attendanceType, String attendanceWay, String companyId, String have, String staffName, String countryCode, String usernameType) => post( addStaffURL.toUrl, jsonEncode({ 'attendanceType': attendanceType, 'attendanceWay': attendanceWay, 'companyId': companyId, 'have': have, 'staffName': staffName, 'countryCode': countryCode, 'usernameType': usernameType, })); // 编辑员工 addHolidaysData Future editStaffData( String attendanceType, String attendanceWay, String staffId, String have, String staffName, String countryCode, String usernameType) => post( editStaffURL.toUrl, jsonEncode({ 'attendanceType': attendanceType, 'attendanceWay': attendanceWay, 'staffId': staffId, 'have': have, 'staffName': staffName, 'countryCode': countryCode, 'usernameType': usernameType, })); // 添加员工选择钥匙 Future addStaffSelectKeyData(String companyId, String type) => post( addStaffSelectKeyURL.toUrl, jsonEncode({ 'companyId': companyId, 'type': type, })); // 添加假期 Future addHolidaysData( String companyId, String fillClassDate, String vacationEndDate, String vacationName, String vacationStartDate) => post( addHolidaysURL.toUrl, jsonEncode({ 'companyId': companyId, 'fillClassDate': fillClassDate, 'vacationEndDate': vacationEndDate, 'vacationName': vacationName, 'vacationStartDate': vacationStartDate, })); // 假期列表 Future holidaysListData(String companyId, String vacationYear) => post( holidaysListURL.toUrl, jsonEncode({ 'companyId': companyId, 'vacationYear': vacationYear, })); // 删除假期 Future deletHolidaysData(String vacationId) => post( holidaysDeleteURL.toUrl, jsonEncode({ 'vacationId': vacationId, })); // 获取考勤设置信息 Future getCheckInSetInfoData(String companyId) => post( getCheckInSetInfoURL.toUrl, jsonEncode({ 'companyId': companyId, })); // 修改考勤设置信息 Future editCheckInSetInfoData( String attendanceType, String companyId, String type, String companyName, String workEndTime, String workStartTime, List workDay) => post( editCheckInSetInfoURL.toUrl, jsonEncode({ 'attendanceType': attendanceType, 'companyId': companyId, 'type': type, 'companyName': companyName, 'workEndTime': workEndTime, 'workStartTime': workStartTime, 'workDay': workDay, })); // 获取考勤列表 -- 早到榜日榜 Future getCheckInListEarlyArrivalWithDateData( String companyId, String attendanceDate) => post( getAttendanceRecordListByDateURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, })); // 获取考勤列表 -- 早到榜月榜 Future getCheckInListEarlyArrivalWithMonthData( String companyId, String attendanceDate) => post( getAttendanceRecordListByMonthURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, })); // 获取考勤列表 -- 迟到榜日榜 Future getCheckInListLateTimesWithDateData( String companyId, String attendanceDate) => post( getAttendanceRecordListLateTimesByDateURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, })); // 获取考勤列表 -- 迟到榜月榜 Future getCheckInListLateTimesWithMonthData( String companyId, String attendanceDate) => post( getAttendanceRecordListLateTimesByMonthURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, })); // 获取考勤列表 -- 勤奋榜 Future getCheckInListHardworkingData( String companyId, String attendanceDate, String type) => post( getAttendanceRecordHardworkingListURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, 'type': type, })); // 获取考勤详情 Future getCheckInDetailData( String companyId, String attendanceDate, String staffId) => post( getAttendanceRecordDtailURL.toUrl, jsonEncode({ 'companyId': companyId, 'attendanceDate': attendanceDate, 'staffId': staffId, })); // 获取指纹列表 Future getFingerprintsListData( String lockId, String pageNo, String pageSize, String searchStr) => post( getFingerprintListURL.toUrl, jsonEncode({ 'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr, })); // 添加指纹 Future addFingerprintsData( String lockId, String endDate, String addType, String fingerprintName, String fingerprintNumber, String fingerprintType, String isCoerced, String startDate, List weekDay, ) => post( addFingerprintURL.toUrl, jsonEncode({ 'lockId': lockId, 'endDate': endDate, 'addType': addType, 'fingerprintName': fingerprintName, 'fingerprintNumber': fingerprintNumber, 'fingerprintType': fingerprintType, 'isCoerced': isCoerced, 'startDate': startDate, 'weekDay': weekDay, })); // 编辑指纹 Future editFingerprintsData( String fingerprintId, String lockId, List weekDay, String startDate, String endDate, String isCoerced, String fingerprintName, String changeType) => post( editFingerprintURL.toUrl, jsonEncode({ 'fingerprintId': fingerprintId, 'lockId': lockId, 'weekDay': weekDay, 'startDate': startDate, 'endDate': endDate, 'isCoerced': isCoerced, 'fingerprintName': fingerprintName, 'changeType': changeType })); // 删除指纹 Future deletFingerprintsData(String fingerprintId, String lockId, String type, String deleteType) => post( deleteFingerprintURL.toUrl, jsonEncode({ 'fingerprintId': fingerprintId, 'lockId': lockId, 'type': type, 'deleteType': deleteType })); // 更新指纹用户序号 Future updateFingerprintUserNoLoadData( String fingerprintId, String lockId, String fingerprintUserNo) => post( updateFingerprintUserNoURL.toUrl, jsonEncode({ 'fingerprintId': fingerprintId, 'lockId': lockId, 'fingerprintUserNo': fingerprintUserNo })); // 校验指纹名字是否重复 Future checkFingerprintNameDuplicatedData( String lockId, String fingerprintName) => post(checkFingerprintNameURL.toUrl, jsonEncode({'lockId': lockId, 'fingerprintName': fingerprintName})); // 获取人脸列表 Future getFaceListData( String lockId, String pageNo, String pageSize, String searchStr) => post( getFaceListURL.toUrl, jsonEncode({ 'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr, })); // 添加人脸 Future addFaceData( int lockId, String faceName, String faceNumber, int faceType, int startDate, int endDate, String featureData, String addType, List cyclicConfig, ) => post( addFaceURL.toUrl, jsonEncode({ 'lockId': lockId, 'faceName': faceName, 'faceNumber': faceNumber, 'faceType': faceType, 'startDate': startDate, 'endDate': endDate, 'featureData': featureData, 'addType': addType, 'cyclicConfig': cyclicConfig, })); // 校验人脸名字是否重复 Future checkFaceNameDuplicatedData( String lockId, String faceName) => post(checkFaceNameURL.toUrl, jsonEncode({'lockId': lockId, 'faceName': faceName})); // 更新人脸用户序号 Future updateFaceUserNo( int faceId, int lockId, String faceUserNo) => post( updateFaceUserNoURL.toUrl, jsonEncode( {'faceId': faceId, 'lockId': lockId, 'faceUserNo': faceUserNo})); // 更新人脸用户信息--人脸名称、有效期 Future updateFaceName(int faceId, int lockId, String faceName) => post( updateFaceUserInfoURL.toUrl, jsonEncode( {'faceId': faceId, 'lockId': lockId, 'faceName': faceName})); // 更新人脸用户信息--有效期 Future updateFaceValidity( int faceId, int lockId, int startDate, int endDate) => post( updateFaceUserInfoURL.toUrl, jsonEncode({ 'faceId': faceId, 'lockId': lockId, 'startDate': startDate, 'endDate': endDate })); // 删除人脸 Future deleteFaceData(int faceId, int lockId) => post( deleteFaceURL.toUrl, jsonEncode({ 'faceId': faceId, 'lockId': lockId, })); // 清空人脸 Future clearFaceData(int lockId) => post( clearFaceURL.toUrl, jsonEncode({ 'lockId': lockId, })); // 获取商城跳转地址 Future getMallURLData() => post(getMallURL.toUrl, jsonEncode({})); // 获取IC卡列表 Future getICCardListData( String lockId, String pageNo, String pageSize, String searchStr) => post( getICCardListURL.toUrl, jsonEncode({ 'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr, })); // 添加卡 Future addICCardData( String lockId, String endDate, String cardName, String cardNumber, String cardType, String addType, String startDate, String isCoerced, List weekDay, ) => post( addICCardURL.toUrl, jsonEncode({ 'lockId': lockId, 'endDate': endDate, 'cardName': cardName, 'cardNumber': cardNumber, 'cardType': cardType, 'addType': addType, 'startDate': startDate, 'isCoerced': isCoerced, 'weekDay': weekDay })); // 编辑ICCard Future editICCardData( String lockId, String cardId, String cardName, String startDate, String endDate, String isCoerced, List weekDay, String changeType) => post( editICCardURL.toUrl, jsonEncode({ 'lockId': lockId, 'cardId': cardId, 'cardName': cardName, 'startDate': startDate, 'endDate': endDate, 'isCoerced': isCoerced, 'weekDay': weekDay, 'changeType': changeType })); // 删除卡 Future deletIcCardData( String cardId, String lockId, String type, String deleteType) => post( deleteICCardURL.toUrl, jsonEncode({ 'cardId': cardId, 'lockId': lockId, 'type': type, 'deleteType': deleteType })); // 更新ICCard序号 Future updateIdCardUserNoLoadData( String lockId, String cardId, String cardUserNo) => post( updateICCardUserNoURL.toUrl, jsonEncode( {'cardId': cardId, 'lockId': lockId, 'cardUserNo': cardUserNo})); // 校验卡名字是否重复 Future checkCardNameDuplicatedData( String lockId, String cardName) => post(checkCardNameURL.toUrl, jsonEncode({'lockId': lockId, 'cardName': cardName})); // 获取转移锁锁列表 Future getTransferLockListData() => post(transferLockListURL.toUrl, jsonEncode({})); // 转移智能锁确认 Future transferLockConfirmInfoData( String receiverUserid, String type, String countryCode) => post( transferLockConfirmURL.toUrl, jsonEncode({ 'receiverUserid': receiverUserid, 'type': type, 'countryCode': countryCode })); // 转移智能锁 Future transferLockInfoData( String receiverUserid, List lockIdList, String countryCode) => post( transferLockURL.toUrl, jsonEncode({ 'receiverUserid': receiverUserid, 'lockIdList': lockIdList, 'countryCode': countryCode })); // 获取网关列表 Future getGatewayListData(String pageNo, String pageSize) => post( gatewaykListURL.toUrl, jsonEncode({'pageNo': pageNo, 'pageSize': pageSize})); // 转移网关确认 Future transferGatewayConfirmInfoData( String receiverUserid, String type, String countryCode) => post( transferGatewayConfirmURL.toUrl, jsonEncode({ 'receiverUserid': receiverUserid, 'type': type, 'countryCode': countryCode })); // 转移网关 Future transferGatewayInfoData( String receiverUserid, List plugIdList, String countryCode) => post( transferGatewayURL.toUrl, jsonEncode({ 'receiverUserid': receiverUserid, 'plugIdList': plugIdList, 'countryCode': countryCode })); Future listLockByGroup(String type, String keyGroupId) => post( listLockByGroupURL.toUrl, jsonEncode({'type': type, 'keyGroupId': keyGroupId})); Future getKeyDetail(String lockId) => post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId})); Future lockUserList( String pageNo, String pageSize, String searchStr) => post( lockUserListURL.toUrl, jsonEncode({ 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr })); Future deletLockUser(int uid) => post( deletLockUserURL.toUrl, jsonEncode({ 'uid': uid, })); Future keyListByUser(String pageNo, String pageSize, String uid) => post(keyListByUserURL.toUrl, jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid})); Future authorizedAdminList(String pageNo, String pageSize) => post( authorizedAdminListURL.toUrl, jsonEncode({'pageNo': pageNo, 'pageSize': pageSize})); Future authorizedAdminDetail(int uid) => post(authorizedAdminDetailURL.toUrl, jsonEncode({'uid': uid})); Future deleteAuthorizedAdmin( String uid, String includeUnderlings) => post(deleteAdministratorURL.toUrl, jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings})); Future updateAuthorizedAdmin(String uid, String name, String endDate, String startDate, String isRemoteUnlock) => post( updateAdministratorURL.toUrl, jsonEncode({ 'uid': uid, 'name': name, 'endDate': endDate, 'startDate': startDate, 'isRemoteUnlock': isRemoteUnlock })); Future setAlertMode(String alertMode, String isOn) => post( setAlertModeURL.toUrl, jsonEncode({'alertMode': alertMode, 'isOn': isOn})); Future changeSettings(String isOn, String type) => post(changeSettingsURL.toUrl, jsonEncode({'isOn': isOn, 'type': type})); Future setTouchUnlockFlag(String isOn) => post(setTouchUnlockFlagURL.toUrl, jsonEncode({'isOn': isOn})); Future userSettingsInfo() => post(userSettingsInfoURL.toUrl, jsonEncode({})); Future canSendKey(String endDate, List lockIdList) => post( canSendKeyURL.toUrl, jsonEncode({'endDate': endDate, 'lockIdList': lockIdList})); Future batchSendKey( String endDate, List keyGroupIdList, List lockIdList, String createUser, String isRemoteUnlock, String keyNameForAdmin, String receiverUsername, String startDate, String countryCode, String usernameType, List weekDays) => post( batchSendKeyURL.toUrl, jsonEncode({ 'endDate': endDate, 'keyGroupIdList': keyGroupIdList, 'lockIdList': lockIdList, 'createUser': createUser, 'isRemoteUnlock': isRemoteUnlock, 'keyNameForAdmin': keyNameForAdmin, 'receiverUsername': receiverUsername, 'startDate': startDate, 'countryCode': countryCode, 'usernameType': usernameType, 'weekDays': weekDays, })); Future addAuthorizedAdmin( String createUser, String endDate, String isRemoteUnlock, List keyGroupIdList, List lockIdList, String name, String startDate, String userid, String countryCode, String usernameType) => post( addAuthorizedAdminURL.toUrl, jsonEncode({ 'createUser': createUser, 'endDate': endDate, 'isRemoteUnlock': isRemoteUnlock, 'keyGroupIdList': keyGroupIdList, 'lockIdList': lockIdList, 'name': name, 'startDate': startDate, 'userid': userid, 'countryCode': countryCode, 'usernameType': usernameType })); //退出登录 Future userLogout() => get(userLogoutURL.toUrl); //删除账号 Future deleteAccount( String channel, String verificationCode) => post( deleteAccountURL.toUrl, jsonEncode( {'channel': channel, 'verificationCode': verificationCode})); // 获取个人信息 Future getUserInfo(String operatorUid) => post(getUserInfoURL.toUrl, jsonEncode({'operatorUid': operatorUid})); // 重置密码钥匙 Future keyboardPwdReset(String lockId) => post(keyboardPwdResetURL.toUrl, jsonEncode({'lockId': lockId})); //登陆后可使用获取验证码,免图片滑动验证 Future getValidationCodeAuth(String countryCode, String account, String channel, String codeType, String uniqueid, String xWidth) => post( getValidationCodeAuthURL.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, "channel": channel, 'codeType': codeType, "uniqueid": uniqueid, 'xWidth': xWidth, })); //更新个人信息-头像/昵称 Future updateUserInfo(String nickname) => post(updateUserInfoURL.toUrl, jsonEncode({'nickname': nickname})); //修改绑定手机号 Future bindPhone(String countryCode, String account, String verificationCode, String unbindToken) => post( bindPhoneURL.toUrl, jsonEncode({ 'countryCode': countryCode, 'account': account, 'verificationCode': verificationCode, 'unbindToken': unbindToken })); //修改绑定邮箱 Future bindEmail( String email, String verificationCode, String unbindToken) => post( bindEmailURL.toUrl, jsonEncode({ 'email': email, 'verificationCode': verificationCode, 'unbindToken': unbindToken })); //修改密码 Future changePassword(String date, String newPassword, String oldPassword, String operatorUid) => post( changePasswordURL.toUrl, jsonEncode({ "date": date, 'newPassword': newPassword, "oldPassword": oldPassword, 'operatorUid': operatorUid })); //获取安全信息列表 Future getQuestionList(String operatorUid, String countryCode) => post( getQuestionListURL.toUrl, jsonEncode({ "operatorUid": operatorUid, 'countryCode': countryCode, })); //获取已设置的安全信息 Future getOwnQuestionList() => post(getOwnQuestionListURL.toUrl, jsonEncode({})); //设置安全信息 Future setSafeAnswer(List questionAndAnswerList) => post( setSafeAnswerURL.toUrl, jsonEncode({"questionAndAnswerList": questionAndAnswerList})); // 获取上传文件的upToken 再调用updateUserInfo Future getUpToken(String module, String typeKey, String type, String filename, int size) => post( getUpTokenURL.toUrl, jsonEncode({ "module": module, typeKey: type, "filename": filename, "size": size, })); // 文件上传 Future uploadFile(String url, dynamic boay) => post(url, boay, isUnUploadFile: false, contentType: 'multipart/form-data'); //获取解绑手机号Token Future unbindPhoneToken(String verificationCode) => post( unbindPhoneTokenURL.toUrl, jsonEncode({"verificationCode": verificationCode})); //获取解绑邮箱Token Future unbindEmailToken(String verificationCode) => post( unbindEmailTokenURL.toUrl, jsonEncode({"verificationCode": verificationCode})); //推送绑定DeviceID Future pushBindAppId(String deviceId, int deviceType) => post( pushBindAppIdURL.toUrl, jsonEncode({"deviceId": deviceId, "deviceType": deviceType})); // 消息列表 Future messageListLoadData(String pageNo, String pageSize) => post( messageListURL.toUrl, jsonEncode({ 'pageNo': pageNo, 'pageSize': pageSize, })); // 读取消息 Future readMessageLoadData(String messageId) => post( readMessageURL.toUrl, jsonEncode({ 'id': messageId, })); // 删除消息 Future deletMessageLoadData(String messageId) => post( deletMessageURL.toUrl, jsonEncode({ 'id': messageId, })); } extension ExtensionString on String { String get toUrl => this; }