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) => post( electronicKeyListURL.toUrl, jsonEncode({ 'endDate': endDate, 'keyId': keyId, "keyStatus": keyStatus, 'lockId': lockId, "operatorUid": operatorUid, 'pageNo': pageNo, 'pageSize': pageSize, 'startDate': startDate, 'keyRight': keyRight })); 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, String operatorUid, ) => post( modifyKeyNameURL.toUrl, jsonEncode({ 'keyId': keyId, 'lockId': lockId, 'keyName': keyName, 'operatorUid': operatorUid, })); 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 bindingBlueAdmin( String bindingDate, String hotelMode, String lockAlias, Map lockData, String nbInitSuccess, Map position, Map bluetooth, String deviceNo, String lockUserNo) => post( bindingBlueAdminURL.toUrl, jsonEncode({ 'bindingDate': bindingDate, 'hotelMode': hotelMode, "lockAlias": lockAlias, 'lockData': lockData, "nbInitSuccess": nbInitSuccess, 'position': position, 'bluetooth': bluetooth, 'deviceNo': deviceNo, 'lockUserNo': lockUserNo, })); // 获取锁信息 Future getLockInfo(String lastUpdateDate, String pageNo) => post( getLockInfoURL.toUrl, jsonEncode({ 'lastUpdateDate': lastUpdateDate, "pageNo": pageNo, })); // 删除锁 Future deletLockInfo(String lockId) => post( deletLockURL.toUrl, jsonEncode({ 'lockId': lockId, })); Future passwordKeyList( String keyStatus, String lockId, String operatorUid, String pageNo, String pageSize, ) => post( passwordKeyListURL.toUrl, jsonEncode({ 'keyStatus': keyStatus, 'lockId': lockId, 'operatorUid': operatorUid, 'pageNo': pageNo, 'pageSize': pageSize })); 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, ) => post( passwordKeyGetURL.toUrl, jsonEncode({ 'endDate': endDate, 'isExclusive': isExclusive, 'keyboardPwdName': keyboardPwdName, 'keyboardPwdType': keyboardPwdType, 'keyboardPwdVersion': keyboardPwdVersion, 'lockId': lockId, 'operatorUid': operatorUid, 'startDate': startDate, 'timezoneRawOffSet': timezoneRawOffSet })); 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 lockGroupList(String type) => post(lockGroupListURL.toUrl, jsonEncode({'type': type})); Future deleteElectronicKey(String keyId) => post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId})); Future deleteKeyboardPwd( String lockId, String keyboardPwdId, String 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 getKeyDetail(String lockId) => post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId})); } extension ExtensionString on String { String get toUrl => this; }