2851 lines
82 KiB
Dart
Executable File
2851 lines
82 KiB
Dart
Executable File
import 'dart:convert';
|
|
|
|
import 'package:get/get.dart';
|
|
import 'api_provider_base.dart';
|
|
|
|
class ApiProvider extends BaseProvider {
|
|
Future<Response> sendValidationCode(String countryCode, String account,
|
|
String channel, String codeType, String xWidth) =>
|
|
post(
|
|
sendValidationCodeUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'channel': channel,
|
|
'codeType': codeType,
|
|
'xWidth': xWidth,
|
|
}));
|
|
|
|
Future<Response> register(
|
|
int receiverType,
|
|
int countryCode,
|
|
String account,
|
|
String password,
|
|
String verificationCode,
|
|
Map deviceInfo,
|
|
) =>
|
|
post(
|
|
registerUrl.toUrl,
|
|
jsonEncode({
|
|
'receiverType': receiverType,
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'password': password,
|
|
'verificationCode': verificationCode,
|
|
'platId': '2',
|
|
'deviceInfo': deviceInfo,
|
|
}));
|
|
|
|
// post(
|
|
// registerUrl.toUrl,
|
|
// jsonEncode({
|
|
// 'countryCode': countryCode,
|
|
// 'countryId': countryId,
|
|
// "mobile": mobile,
|
|
// 'password': password,
|
|
// 'platId': "2",
|
|
// "uniqueid": uniqueid,
|
|
// 'verificationCode': verificationCode,
|
|
// }));
|
|
|
|
Future<Response> getSliderVerifyImg(String countryCode, String account) =>
|
|
post(
|
|
getSliderVerifyImgUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
}));
|
|
|
|
Future<Response> checkSliderVerifyImg(
|
|
String countryCode, String account, String xWidth) =>
|
|
post(
|
|
checkImgUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'xWidth': xWidth,
|
|
}));
|
|
|
|
Future<Response> login(String loginType, String password, String countryCode,
|
|
String username, Map deviceInfo) =>
|
|
post(
|
|
loginUrl.toUrl,
|
|
jsonEncode({
|
|
'loginType': loginType,
|
|
'password': password,
|
|
'platId': '2',
|
|
'uniqueid': '477E6814-289D-402A-9F49-F89A8BD05D63',
|
|
'countryCode': countryCode,
|
|
'username': username,
|
|
'deviceInfo': deviceInfo,
|
|
}));
|
|
|
|
Future<Response> oneClickLogin(
|
|
String loginType, String loginToken, Map deviceInfo) =>
|
|
post(
|
|
oneClickLoginUrl.toUrl,
|
|
jsonEncode({
|
|
'loginType': loginType,
|
|
'platId': '2',
|
|
'loginToken': loginToken,
|
|
'deviceInfo': deviceInfo,
|
|
}));
|
|
|
|
Future<Response> 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<Response> getCountryRegion(String type) =>
|
|
post(getCountryRegionURL.toUrl, jsonEncode({'type': type}));
|
|
|
|
Future<Response> electronicKeyList(
|
|
String endDate,
|
|
String keyId,
|
|
String keyStatus,
|
|
String keyRight,
|
|
String lockId,
|
|
String pageNo,
|
|
String pageSize,
|
|
String startDate,
|
|
String searchStr,
|
|
) =>
|
|
post(
|
|
electronicKeyListURL.toUrl,
|
|
jsonEncode({
|
|
'endDate': endDate,
|
|
'keyId': keyId,
|
|
'keyStatus': keyStatus,
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'startDate': startDate,
|
|
'keyRight': keyRight,
|
|
'searchStr': searchStr
|
|
}));
|
|
|
|
Future<Response> electronicKey(int lockId, int keyId) => post(
|
|
keydetail.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId.toString(),
|
|
'keyId': keyId.toString(),
|
|
}));
|
|
|
|
Future<Response> sendElectronicKey(
|
|
int createUser,
|
|
String countryCode,
|
|
String usernameType,
|
|
int endDate,
|
|
String faceAuthentication,
|
|
String isCameraEnable,
|
|
String isRemoteUnlock,
|
|
String keyNameForAdmin,
|
|
String keyRight,
|
|
String keyType,
|
|
String lockId,
|
|
String operatorUid,
|
|
String receiverUsername,
|
|
String remarks,
|
|
int startDate,
|
|
List weekDays,
|
|
int startTime,
|
|
int endTime,
|
|
int isOnlyManageSelf,
|
|
String realName,
|
|
String idCardNumber) =>
|
|
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,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'isOnlyManageSelf': isOnlyManageSelf,
|
|
'realName': realName,
|
|
'idCardNumber': idCardNumber
|
|
}));
|
|
|
|
Future<Response<dynamic>> uploadElectricQuantity(
|
|
String electricQuantity,
|
|
String electricQuantityStandby,
|
|
String lockId,
|
|
bool isUnShowLoading,
|
|
) =>
|
|
post(
|
|
uploadElectricQuantityURL.toUrl,
|
|
jsonEncode({
|
|
'electricQuantity': electricQuantity,
|
|
'electricQuantityStandby': electricQuantityStandby,
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: isUnShowLoading,
|
|
isShowErrMsg: false,
|
|
);
|
|
|
|
Future<Response> modifyKeyName(
|
|
String keyId,
|
|
String lockId,
|
|
String keyName,
|
|
) =>
|
|
post(
|
|
modifyKeyNameURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'lockId': lockId,
|
|
'keyName': keyName,
|
|
}));
|
|
|
|
Future<Response> modifyKeyNameForAdmin(
|
|
String keyId,
|
|
String keyNameForAdmin,
|
|
String operatorUid,
|
|
) =>
|
|
post(
|
|
modifyKeyNameForAdminURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'keyNameForAdmin': keyNameForAdmin,
|
|
'operatorUid': operatorUid,
|
|
}));
|
|
|
|
Future<Response> updateKeyDate(
|
|
String keyId,
|
|
String lockId,
|
|
String endDate,
|
|
String startDate,
|
|
List weekDays,
|
|
int keyType,
|
|
int startTime,
|
|
int endTime,
|
|
int isOnlyManageSelf,
|
|
int remoteEnable) =>
|
|
post(
|
|
updateKeyDateURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'lockId': lockId,
|
|
'endDate': endDate,
|
|
'startDate': startDate,
|
|
'weekDays': weekDays,
|
|
'keyType': keyType,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'isOnlyManageSelf': isOnlyManageSelf,
|
|
'remoteEnable': remoteEnable,
|
|
}));
|
|
|
|
// 更新钥匙实名认证信息
|
|
Future<Response> updateRealNameInfo(
|
|
int lockId,
|
|
int keyId,
|
|
int uid,
|
|
int faceAuthentication,
|
|
String realName,
|
|
String idCardNumber,
|
|
) =>
|
|
post(
|
|
updateRealNameInfoURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'uid': uid,
|
|
'faceAuthentication': faceAuthentication,
|
|
'realName': realName,
|
|
'idCardNumber': idCardNumber,
|
|
}));
|
|
|
|
Future<Response> resetElectronicKey(String lockId, String operatorUid) =>
|
|
post(resetElectronicKeyURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
|
|
|
Future<Response> lockRecordList(
|
|
{required String lockId,
|
|
required String pageNo,
|
|
required String recordType,
|
|
required String searchStr,
|
|
required String startDate,
|
|
required String endDate,
|
|
required String keyboardPwdId,
|
|
required String cardId,
|
|
required String fingerprintId,
|
|
required String keyId,
|
|
required String faceId,
|
|
required String remoteId,
|
|
required String palmVeinId,
|
|
required String pageSize}) =>
|
|
post(
|
|
keyOperationRecordURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'recordType': recordType,
|
|
'searchStr': searchStr,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'cardId': cardId,
|
|
'fingerprintId': fingerprintId,
|
|
'keyId': keyId,
|
|
'faceId': faceId,
|
|
'remoteId': remoteId,
|
|
'palmVeinId': palmVeinId,
|
|
'pageSize': pageSize
|
|
}));
|
|
|
|
// 门锁事件日志
|
|
Future<Response> lockEventList(int lockId, int lockEventType, int pageNo,
|
|
int pageSize, int startDate, int endDate) =>
|
|
post(
|
|
lockEventListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'lockEventType': lockEventType,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
}));
|
|
|
|
// 锁记录上传
|
|
Future<Response> lockRecordUploadData(String lockId, List records) => post(
|
|
lockRecordUploadURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'records': records,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 查询锁记录最后时间
|
|
Future<Response> getLockRecordLastUploadDataTime(String lockId) => post(
|
|
getLockRecordLastUploadDataTimeURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: true,
|
|
isShowErrMsg: false,
|
|
);
|
|
|
|
// 获取手机联网token
|
|
Future<Response> getLockNetToken(int lockId) => post(
|
|
getLockNetTokenURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 更新锁用户NO
|
|
Future<Response> updateLockUserNo(String keyId, String lockUserNo) => post(
|
|
updateLockUserNoURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'lockUserNo': lockUserNo,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 更新锁InitUserNo
|
|
Future<Response> updateLockInitUserNo(int lockId, int initUserNo) => post(
|
|
lockUpdateLockInfo.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'initUserNo': initUserNo,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 绑定蓝牙管理员
|
|
Future<Response> 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<Response> getLockInfo(String lastUpdateDate, String pageNo) => post(
|
|
getLockInfoURL.toUrl,
|
|
jsonEncode({
|
|
'lastUpdateDate': lastUpdateDate,
|
|
'pageNo': pageNo,
|
|
}));
|
|
|
|
// 获取锁信息列表
|
|
Future<Response> getStarLockListInfo(
|
|
int pageNo,
|
|
int pageSize, {
|
|
bool isUnShowLoading = true,
|
|
int? keyId,
|
|
}) =>
|
|
post(
|
|
getStarLockInfoURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'keyId': keyId,
|
|
}),
|
|
isUnShowLoading: isUnShowLoading);
|
|
|
|
// 获取所有锁设置信息
|
|
Future<Response> getLockSettingInfoData(
|
|
String lockId, {
|
|
bool isUnShowLoading = true,
|
|
}) =>
|
|
post(
|
|
getLockSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: isUnShowLoading,
|
|
);
|
|
|
|
// 获取所有锁设置信息
|
|
Future<Response> getLockSettingInfoDataIsNotLoadingIcon(String lockId) =>
|
|
post(
|
|
getLockSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 删除锁
|
|
Future<Response> deletLockInfo(int lockId) => post(
|
|
deletLockURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 删除拥有的当前钥匙
|
|
Future<Response> deletOwnerKeyInfo(
|
|
String lockId, String keyId, int includeUnderlings) =>
|
|
post(
|
|
deleteElectronicKeyURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'includeUnderlings': includeUnderlings
|
|
}));
|
|
|
|
// 检查账户密码
|
|
Future<Response> checkLoginPassword(String password) => post(
|
|
checkPasswordURL.toUrl,
|
|
jsonEncode({
|
|
'password': password,
|
|
}));
|
|
|
|
// 获取Wifi锁服务器
|
|
Future<Response> getWifiLockServiceIpAndPort() =>
|
|
post(getWifiServiceIpURL.toUrl, jsonEncode({}), isUnShowLoading: true);
|
|
|
|
Future<Response> 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<Response> passwordKey(
|
|
int lockId,
|
|
int keyboardPwdId,
|
|
) =>
|
|
post(passwordKeyDetailURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'keyboardPwdId': keyboardPwdId}));
|
|
|
|
Future<Response> resetPasswordKey(String lockId, String operatorUid) => post(
|
|
resetPasswordURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
|
|
|
Future<Response> getKeyboardPwd(
|
|
String endDate,
|
|
String keyboardPwdName,
|
|
String keyboardPwdType,
|
|
int lockId,
|
|
String startDate,
|
|
int startHours,
|
|
int endHours,
|
|
int isCoerced) =>
|
|
post(
|
|
passwordKeyGetURL.toUrl,
|
|
jsonEncode({
|
|
'endDate': endDate,
|
|
'keyboardPwdName': keyboardPwdName,
|
|
'keyboardPwdType': keyboardPwdType,
|
|
'lockId': lockId,
|
|
'startDate': startDate,
|
|
'hoursStart': startHours,
|
|
'hoursEnd': endHours,
|
|
'isCoerced': isCoerced,
|
|
}));
|
|
|
|
// 更新锁用户序号
|
|
Future<Response> updatePWDNumber(
|
|
String lockId, String keyboardPwdId, String pwdUserNo) =>
|
|
post(
|
|
updatePWDNumberURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'pwdUserNo': pwdUserNo
|
|
}));
|
|
|
|
Future<Response> addKeyboardPwd(
|
|
String lockId,
|
|
String keyboardPwdName,
|
|
String keyboardPwd,
|
|
String keyboardPwdType,
|
|
String startDate,
|
|
String endDate,
|
|
String addType,
|
|
int? pwdRight,
|
|
) =>
|
|
post(
|
|
passwordKeyAddURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyboardPwdName': keyboardPwdName,
|
|
'keyboardPwd': keyboardPwd,
|
|
'keyboardPwdType': keyboardPwdType,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'addType': addType,
|
|
'pwdRight': pwdRight
|
|
}));
|
|
|
|
// 自定义密码校验名字密码是否重复
|
|
Future<Response> checkKeyboardpwdName(
|
|
String lockId, String keyboardPwdName, String keyboardPwd) =>
|
|
post(
|
|
passwordKeyCheckKeyboardpwdNameURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyboardPwdName': keyboardPwdName,
|
|
'keyboardPwd': keyboardPwd,
|
|
}));
|
|
|
|
Future<Response> updateKeyboardPwd(
|
|
int lockId,
|
|
String keyboardPwdId,
|
|
String keyboardPwdName,
|
|
String newKeyboardPwd,
|
|
int startDate,
|
|
int endDate,
|
|
String changeType,
|
|
String isCoerced,
|
|
int hoursStart,
|
|
int hoursEnd,
|
|
int keyboardPwdType,
|
|
int pwdRight) =>
|
|
post(
|
|
updatePasswordKeyURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'keyboardPwdName': keyboardPwdName,
|
|
'newKeyboardPwd': newKeyboardPwd,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'changeType': changeType,
|
|
'isCoerced': isCoerced,
|
|
'hoursStart': hoursStart,
|
|
'hoursEnd': hoursEnd,
|
|
'keyboardPwdType': keyboardPwdType,
|
|
'pwdRight': pwdRight
|
|
}));
|
|
|
|
Future<Response> clearOperationRecord(String lockId) =>
|
|
post(clearOperationRecordURL.toUrl, jsonEncode({'lockId': lockId}));
|
|
|
|
Future<Response> addLockGroup(String groupName, String operatorUid) => post(
|
|
addlockGroupURL.toUrl,
|
|
jsonEncode({'groupName': groupName, 'operatorUid': operatorUid}));
|
|
|
|
// 编辑锁名字
|
|
Future<Response> editLockGroupRequest(int groupId, String groupName) => post(
|
|
editlockGroupURL.toUrl,
|
|
jsonEncode({'groupId': groupId, 'groupName': groupName}));
|
|
|
|
Future<Response> setLockGroup(String lockId, String groupId) => post(
|
|
setlockGroupURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'groupId': groupId}));
|
|
|
|
Future<Response> lockGroupList(String type) =>
|
|
post(lockGroupListURL.toUrl, jsonEncode({'type': type}));
|
|
|
|
// 删除组
|
|
Future<Response> deleteGroup(int groupId) => post(
|
|
lockDeletGroupURL.toUrl,
|
|
jsonEncode({
|
|
'groupId': groupId,
|
|
}));
|
|
|
|
// 锁分组里面添加锁
|
|
Future<Response> lockGroupAddLock(List lockIds, int groupId) => post(
|
|
lockGroupAddLockURL.toUrl,
|
|
jsonEncode({
|
|
'lockIds': lockIds,
|
|
'groupId': groupId,
|
|
}));
|
|
|
|
// 锁分组里面删除锁
|
|
Future<Response> lockGroupDeletLock(List lockIds) => post(
|
|
lockGroupDeletLockURL.toUrl,
|
|
jsonEncode({
|
|
'lockIds': lockIds,
|
|
}));
|
|
|
|
Future<Response> selectLockList(String searchStr) => post(
|
|
selectLockListURL.toUrl,
|
|
jsonEncode({
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
//APP开锁时需手机联网的锁
|
|
Future<Response> setAppUnlockMustOnline(List lockIdList) => post(
|
|
setAppUnlockMustOnlineURL.toUrl, jsonEncode({'lockIdList': lockIdList}));
|
|
|
|
Future<Response> deleteElectronicKey(String keyId, int includeUnderlings) =>
|
|
post(
|
|
deleteElectronicKeyURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'includeUnderlings': includeUnderlings,
|
|
}));
|
|
|
|
Future<Response> deleteAdministrator(String uid, String includeUnderlings) =>
|
|
post(deleteElectronicKeyURL.toUrl,
|
|
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
|
|
|
Future<Response> updateAdministrator(
|
|
String uid,
|
|
String keyName,
|
|
String endDate,
|
|
String startDate,
|
|
int isOnlyManageSelf,
|
|
int keyType) =>
|
|
post(
|
|
updateAdministratorURL.toUrl,
|
|
jsonEncode({
|
|
'uid': uid,
|
|
'keyName': keyName,
|
|
'endDate': endDate,
|
|
'startDate': startDate,
|
|
'isOnlyManageSelf': isOnlyManageSelf,
|
|
'keyType': keyType,
|
|
}));
|
|
|
|
// 设置授权管理员
|
|
Future<Response> setAdministrator(String keyId) => post(
|
|
setAuthorizeURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
}));
|
|
|
|
// 取消授权管理员
|
|
Future<Response> cancelAdministrator(String keyId) => post(
|
|
cancelAuthorizeURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
}));
|
|
|
|
// 冻结
|
|
Future<Response> freezeKey(String keyId, int includeUnderlings) => post(
|
|
freezeKeyURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'includeUnderlings': includeUnderlings,
|
|
}));
|
|
|
|
// 解除冻结
|
|
Future<Response> cancelFreeze(String keyId, int includeUnderlings) => post(
|
|
cancelFreezeURL.toUrl,
|
|
jsonEncode({
|
|
'keyId': keyId,
|
|
'includeUnderlings': includeUnderlings,
|
|
}));
|
|
|
|
Future<Response> expireLockList(String pageNo, String pageSize) => post(
|
|
expireLockListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
Future<Response> expirePasswordList(String pageNo, String pageSize) => post(
|
|
expirePasswordListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
Future<Response> expireCardList(String pageNo, String pageSize) => post(
|
|
expireCardListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
Future<Response> expireFingerprintList(String pageNo, String pageSize) =>
|
|
post(
|
|
expireFingerprintListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
Future<Response> expireFaceList(String pageNo, String pageSize) => post(
|
|
expireFaceListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
Future<Response> deleteKeyboardPwd(
|
|
String lockId, String keyboardPwdId, int deleteType) =>
|
|
post(
|
|
deleteKeyboardPwdURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'deleteType': deleteType
|
|
}));
|
|
|
|
// Future<Response> updateSetting(String lockId, String isOn, String type) =>
|
|
// post(updateSettingURL.toUrl,
|
|
// jsonEncode({'lockId': lockId, 'isOn': isOn, 'type': type}));
|
|
|
|
// Future<Response> keyGroupList(String type) =>
|
|
// post(keyGroupListURL.toUrl, jsonEncode({'type': type}));
|
|
//
|
|
// Future<Response> lockListByGroup(String type, String keyGroupId) => post(
|
|
// lockListByGroupURL.toUrl,
|
|
// jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
|
|
|
/// 锁设置模块
|
|
// 自动闭锁
|
|
Future<Response> setAutoUnlockLoadData(
|
|
int lockId, int autoLock, int autoLockSecond) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'autoLock': autoLock,
|
|
'autoLockSecond': autoLockSecond,
|
|
}));
|
|
|
|
/// 更新网络信息 配网之后把网络信息提交到服务器保存
|
|
Future<Response> updateNetworkInfo(int lockId, String network) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'network': network,
|
|
}));
|
|
|
|
// 锁声音
|
|
Future<Response> setLockSoundData(
|
|
int lockId, int lockSound, int lockSoundVolume) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'lockSound': lockSound,
|
|
'lockSoundVolume': lockSoundVolume,
|
|
}));
|
|
|
|
// 防撬报警
|
|
Future<Response> setBurglarAlarmData(int lockId, int antiPrySwitch) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'antiPrySwitch': antiPrySwitch,
|
|
}));
|
|
|
|
// 开门方向
|
|
Future<Response> setOpenDoorDirectionData(
|
|
int lockId, int openDirectionValue) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'openDirectionValue': openDirectionValue,
|
|
}));
|
|
|
|
// 电机扭力设置
|
|
Future<Response> setMotorPowerData(int lockId, int motorTorsion) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'motorTorsion': motorTorsion,
|
|
}));
|
|
|
|
// 远程开锁
|
|
Future<Response> remoteUnlockingOpenOrCloseLoadData(
|
|
int lockId, int remoteUnlock) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'remoteUnlock': remoteUnlock,
|
|
}));
|
|
|
|
// 重置键
|
|
Future<Response> setResetButtonData(int lockId, int resetSwitch) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'resetSwitch': resetSwitch,
|
|
}));
|
|
|
|
// 设置考勤
|
|
Future<Response> setCheckInData(int lockId, int resetSwitch) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'attendance': resetSwitch,
|
|
}));
|
|
|
|
// 设置开锁时是否需联网
|
|
Future<Response> setOpenLockNeedOnlineData(int lockId, int appUnlockOnline) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'appUnlockOnline': appUnlockOnline,
|
|
}));
|
|
|
|
// 设置标记房态
|
|
Future<Response> setRoomStatusData(int lockId, int roomStatus) => post(
|
|
setRoomStatusURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'roomStatus': roomStatus,
|
|
}));
|
|
|
|
// 设置常开模式
|
|
Future<Response> setNormallyModeData(
|
|
int lockId, int passageMode, List passageModeConfig) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'passageMode': passageMode,
|
|
'passageModeConfig': passageModeConfig,
|
|
}));
|
|
|
|
// 通过网关获取锁的时间
|
|
Future<Response> getLockTimeFromGatewayLoadData(String lockId) => post(
|
|
roomQueryDateUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 设置管理员开锁密码
|
|
Future<Response> setAdminPasswordData(int lockId, String adminPwd) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'adminPwd': adminPwd,
|
|
}));
|
|
|
|
// 获取服务器当前时间
|
|
Future<Response> getServerDatetimeLoadData(bool isUnShowLoading) =>
|
|
post(getServerDatetimeUrl.toUrl, jsonEncode({}),
|
|
isUnShowLoading: isUnShowLoading);
|
|
|
|
// 锁诊断
|
|
Future<Response> 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<Response> getLockVersionInfoLoadData(String lockId) => post(
|
|
getLockVersionInfoUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
Future<Response> updateLockName(
|
|
String lockId,
|
|
String lockName,
|
|
) =>
|
|
post(
|
|
updateLockNameURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'lockName': lockName,
|
|
}));
|
|
|
|
// 开启考勤获取考勤信息
|
|
Future<Response> openCheckingInGetData(String lockId) => post(
|
|
openCheckingInURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 设置考勤时创建公司
|
|
Future<Response> 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<Response> deletCompanyData(int companyId) => post(
|
|
deleteCompanyURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 获取开锁提醒
|
|
Future<Response> setLockPickingReminderData(int lockId, int unlockReminder) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'unlockReminder': unlockReminder,
|
|
}));
|
|
|
|
// 获取员工列表
|
|
Future<Response> getStaffListData(String companyId, String lockId) => post(
|
|
getStaffListURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 删除
|
|
Future<Response> deletStaffData(int lockId, int staffId, int deleteKey) =>
|
|
post(
|
|
deleteStaffURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'staffId': staffId,
|
|
'deleteKey': deleteKey,
|
|
}));
|
|
|
|
// 添加员工
|
|
Future<Response> 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<Response> 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<Response> addStaffSelectKeyData(String companyId, String type) => post(
|
|
addStaffSelectKeyURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'type': type,
|
|
}));
|
|
|
|
// 添加假期
|
|
Future<Response> 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<Response> holidaysListData(String companyId, String vacationYear) =>
|
|
post(
|
|
holidaysListURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'vacationYear': vacationYear,
|
|
}));
|
|
|
|
// 删除假期
|
|
Future<Response> deletHolidaysData(String vacationId) => post(
|
|
holidaysDeleteURL.toUrl,
|
|
jsonEncode({
|
|
'vacationId': vacationId,
|
|
}));
|
|
|
|
// 获取考勤设置信息
|
|
Future<Response> getCheckInSetInfoData(String companyId) => post(
|
|
getCheckInSetInfoURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
}));
|
|
|
|
// 修改考勤设置信息
|
|
Future<Response> editCheckInSetInfoData(
|
|
String attendanceType,
|
|
String companyId,
|
|
String type,
|
|
String companyName,
|
|
String workEndTime,
|
|
String workStartTime,
|
|
List<int> workDay) =>
|
|
post(
|
|
editCheckInSetInfoURL.toUrl,
|
|
jsonEncode({
|
|
'attendanceType': attendanceType,
|
|
'companyId': companyId,
|
|
'type': type,
|
|
'companyName': companyName,
|
|
'workEndTime': workEndTime,
|
|
'workStartTime': workStartTime,
|
|
'workDay': workDay,
|
|
}));
|
|
|
|
// 获取考勤列表 -- 早到榜日榜
|
|
Future<Response> getCheckInListEarlyArrivalWithDateData(
|
|
String companyId, String attendanceDate) =>
|
|
post(
|
|
getAttendanceRecordListByDateURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
}));
|
|
|
|
// 获取考勤列表 -- 早到榜月榜
|
|
Future<Response> getCheckInListEarlyArrivalWithMonthData(
|
|
String companyId, String attendanceDate) =>
|
|
post(
|
|
getAttendanceRecordListByMonthURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
}));
|
|
|
|
// 获取考勤列表 -- 迟到榜日榜
|
|
Future<Response> getCheckInListLateTimesWithDateData(
|
|
String companyId, String attendanceDate) =>
|
|
post(
|
|
getAttendanceRecordListLateTimesByDateURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
}));
|
|
|
|
// 获取考勤列表 -- 迟到榜月榜
|
|
Future<Response> getCheckInListLateTimesWithMonthData(
|
|
String companyId, String attendanceDate) =>
|
|
post(
|
|
getAttendanceRecordListLateTimesByMonthURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
}));
|
|
|
|
// 获取考勤列表 -- 勤奋榜
|
|
Future<Response> getCheckInListHardworkingData(
|
|
String companyId, String attendanceDate, String type) =>
|
|
post(
|
|
getAttendanceRecordHardworkingListURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
'type': type,
|
|
}));
|
|
|
|
// 获取考勤详情
|
|
Future<Response> getCheckInDetailData(
|
|
String companyId, String attendanceDate, String staffId) =>
|
|
post(
|
|
getAttendanceRecordDtailURL.toUrl,
|
|
jsonEncode({
|
|
'companyId': companyId,
|
|
'attendanceDate': attendanceDate,
|
|
'staffId': staffId,
|
|
}));
|
|
|
|
// 获取指纹详情
|
|
Future<Response> getFingerprintsData(int fingerprintId) => post(
|
|
getFingerprintDetailURL.toUrl,
|
|
jsonEncode({
|
|
'fingerprintId': fingerprintId,
|
|
}));
|
|
|
|
// 获取指纹列表
|
|
Future<Response> getFingerprintsListData(
|
|
String lockId, String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
getFingerprintListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
// 添加指纹
|
|
Future<Response> addFingerprintsData(
|
|
String lockId,
|
|
String endDate,
|
|
String addType,
|
|
String fingerprintName,
|
|
String fingerprintNumber,
|
|
String fingerprintType,
|
|
String isCoerced,
|
|
String startDate,
|
|
List weekDay,
|
|
int fingerRight,
|
|
int startTime,
|
|
int endTime,
|
|
) =>
|
|
post(
|
|
addFingerprintURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'endDate': endDate,
|
|
'addType': addType,
|
|
'fingerprintName': fingerprintName,
|
|
'fingerprintNumber': fingerprintNumber,
|
|
'fingerprintType': fingerprintType,
|
|
'isCoerced': isCoerced,
|
|
'startDate': startDate,
|
|
'weekDay': weekDay,
|
|
'fingerRight': fingerRight,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
}));
|
|
|
|
// 编辑指纹
|
|
Future<Response> editFingerprintsData(
|
|
String fingerprintId,
|
|
String lockId,
|
|
List weekDay,
|
|
String startDate,
|
|
String endDate,
|
|
String isCoerced,
|
|
String fingerprintName,
|
|
String changeType,
|
|
int startTime,
|
|
int endTime,
|
|
int fingerprintType,
|
|
int fingerRight) =>
|
|
post(
|
|
editFingerprintURL.toUrl,
|
|
jsonEncode({
|
|
'fingerprintId': fingerprintId,
|
|
'lockId': lockId,
|
|
'weekDay': weekDay,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'isCoerced': isCoerced,
|
|
'fingerprintName': fingerprintName,
|
|
'changeType': changeType,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'fingerprintType': fingerprintType,
|
|
'fingerRight': fingerRight
|
|
}));
|
|
|
|
// 删除指纹
|
|
Future<Response> deletFingerprintsData(String fingerprintId, String lockId,
|
|
String type, String deleteType) =>
|
|
post(
|
|
deleteFingerprintURL.toUrl,
|
|
jsonEncode({
|
|
'fingerprintId': fingerprintId,
|
|
'lockId': lockId,
|
|
'type': type,
|
|
'deleteType': deleteType
|
|
}));
|
|
|
|
// 更新指纹用户序号
|
|
Future<Response> updateFingerprintUserNoLoadData(
|
|
String fingerprintId, String lockId, String fingerprintUserNo) =>
|
|
post(
|
|
updateFingerprintUserNoURL.toUrl,
|
|
jsonEncode({
|
|
'fingerprintId': fingerprintId,
|
|
'lockId': lockId,
|
|
'fingerprintUserNo': fingerprintUserNo
|
|
}));
|
|
|
|
// 校验指纹名字是否重复
|
|
Future<Response> checkFingerprintNameDuplicatedData(
|
|
String lockId, String fingerprintName) =>
|
|
post(checkFingerprintNameURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'fingerprintName': fingerprintName}));
|
|
|
|
// 获取人脸列表
|
|
Future<Response> getFaceListData(
|
|
String lockId, String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
getFaceListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
// 添加人脸
|
|
Future<Response> addFaceData(
|
|
int lockId,
|
|
String faceName,
|
|
String faceNumber,
|
|
int faceType,
|
|
int startDate,
|
|
int endDate,
|
|
String featureData,
|
|
String addType,
|
|
List weekDay,
|
|
int startTime,
|
|
int endTime,
|
|
int faceRight,
|
|
) =>
|
|
post(
|
|
addFaceURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceName': faceName,
|
|
'faceNumber': faceNumber,
|
|
'faceType': faceType,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'featureData': featureData,
|
|
'addType': addType,
|
|
'weekDay': weekDay,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'faceRight': faceRight
|
|
}));
|
|
|
|
// 校验人脸名字是否重复
|
|
Future<Response> checkFaceNameDuplicatedData(
|
|
String lockId, String faceName) =>
|
|
post(checkFaceNameURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'faceName': faceName}));
|
|
|
|
// 更新人脸用户序号
|
|
Future<Response> updateFaceUserNo(
|
|
int faceId, int lockId, String faceUserNo) =>
|
|
post(
|
|
updateFaceUserNoURL.toUrl,
|
|
jsonEncode(
|
|
{'faceId': faceId, 'lockId': lockId, 'faceUserNo': faceUserNo}));
|
|
|
|
// 更新人脸用户信息--人脸名称、有效期
|
|
Future<Response> updateFaceName(int faceId, int lockId, String faceName) =>
|
|
post(
|
|
updateFaceUserInfoURL.toUrl,
|
|
jsonEncode(
|
|
{'faceId': faceId, 'lockId': lockId, 'faceName': faceName}));
|
|
|
|
// 更新人脸用户信息--有效期
|
|
Future<Response> updateFaceValidity(
|
|
int faceId,
|
|
int lockId,
|
|
int startDate,
|
|
int endDate,
|
|
int startTime,
|
|
int endTime,
|
|
int faceType,
|
|
List weekDay,
|
|
String faceName,
|
|
String addType,
|
|
int isCoerced,
|
|
int faceRight) =>
|
|
post(
|
|
updateFaceUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceId': faceId,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'faceType': faceType,
|
|
'weekDay': weekDay,
|
|
'faceName': faceName,
|
|
'addType': addType,
|
|
'isCoerced': isCoerced,
|
|
'faceRight': faceRight
|
|
}));
|
|
|
|
// 删除人脸
|
|
Future<Response> deleteFaceData(int faceId, int lockId) => post(
|
|
deleteFaceURL.toUrl,
|
|
jsonEncode({
|
|
'faceId': faceId,
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 清空人脸
|
|
Future<Response> clearFaceData(int lockId) => post(
|
|
clearFaceURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 获取商城跳转地址
|
|
Future<Response> getMallURLData() => post(getMallURL.toUrl, jsonEncode({}));
|
|
|
|
// 获取IC卡列表
|
|
Future<Response> getICCardListData(
|
|
String lockId, String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
getICCardListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
// 添加卡
|
|
Future<Response> addICCardData(
|
|
String lockId,
|
|
String endDate,
|
|
String cardName,
|
|
String cardNumber,
|
|
int cardType,
|
|
String addType,
|
|
String startDate,
|
|
String isCoerced,
|
|
List weekDay,
|
|
int startTime,
|
|
int endTime,
|
|
int cardRight,
|
|
) =>
|
|
post(
|
|
addICCardURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'endDate': endDate,
|
|
'cardName': cardName,
|
|
'cardNumber': cardNumber,
|
|
'cardType': cardType,
|
|
'addType': addType,
|
|
'startDate': startDate,
|
|
'isCoerced': isCoerced,
|
|
'weekDay': weekDay,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'cardRight': cardRight
|
|
}));
|
|
|
|
// 编辑ICCard
|
|
Future<Response> editICCardData(
|
|
String lockId,
|
|
String cardId,
|
|
String cardName,
|
|
String startDate,
|
|
String endDate,
|
|
String isCoerced,
|
|
List weekDay,
|
|
String changeType,
|
|
int startTime,
|
|
int endTime,
|
|
int cardType,
|
|
int cardRight,
|
|
) =>
|
|
post(
|
|
editICCardURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'cardId': cardId,
|
|
'cardName': cardName,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'isCoerced': isCoerced,
|
|
'weekDay': weekDay,
|
|
'changeType': changeType,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'cardType': cardType,
|
|
'cardRight': cardRight
|
|
}));
|
|
|
|
// 删除卡
|
|
Future<Response> deletIcCardData(
|
|
String cardId, String lockId, String type, String deleteType) =>
|
|
post(
|
|
deleteICCardURL.toUrl,
|
|
jsonEncode({
|
|
'cardId': cardId,
|
|
'lockId': lockId,
|
|
'type': type,
|
|
'deleteType': deleteType
|
|
}));
|
|
|
|
// 更新ICCard序号
|
|
Future<Response> updateIdCardUserNoLoadData(
|
|
String lockId, String cardId, String cardUserNo) =>
|
|
post(
|
|
updateICCardUserNoURL.toUrl,
|
|
jsonEncode(
|
|
{'cardId': cardId, 'lockId': lockId, 'cardUserNo': cardUserNo}));
|
|
|
|
// 校验卡名字是否重复
|
|
Future<Response> checkCardNameDuplicatedData(
|
|
String lockId, String cardName) =>
|
|
post(checkCardNameURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'cardName': cardName}));
|
|
|
|
// 获取遥控列表
|
|
Future<Response> getRemoteControlListData(
|
|
String lockId, String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
getRemoteControlListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
// 添加遥控
|
|
Future<Response> addRemoteControlData(
|
|
String lockId,
|
|
String remoteName,
|
|
String remoteNumber,
|
|
int remoteType,
|
|
int startDate,
|
|
int endDate,
|
|
int addType,
|
|
List weekDay,
|
|
int startTime,
|
|
int endTime,
|
|
int remoteRight,
|
|
// String mac,
|
|
// int electricQuantity,
|
|
// List firmwareInfo
|
|
) =>
|
|
post(
|
|
addRemoteControlURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'remoteName': remoteName,
|
|
'remoteNumber': remoteNumber,
|
|
'remoteType': remoteType,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'addType': addType,
|
|
'weekDay': weekDay,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'remoteRight': remoteRight,
|
|
// 'mac': '',
|
|
// 'electricQuantity': electricQuantity,
|
|
// 'firmwareInfo': firmwareInfo,
|
|
}));
|
|
|
|
// 更新遥控序号
|
|
Future<Response> updateRemoteUserNoLoadData(
|
|
int lockId, int remoteId, String remoteUserNo) =>
|
|
post(
|
|
updateRemoteUserNoURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'remoteId': remoteId,
|
|
'remoteUserNo': remoteUserNo
|
|
}));
|
|
|
|
// 编辑遥控
|
|
Future<Response> editRemoteControlData(
|
|
int lockId,
|
|
int remoteId,
|
|
int startDate,
|
|
int endDate,
|
|
int startTime,
|
|
int endTime,
|
|
int remoteType,
|
|
List weekDay,
|
|
String remoteName,
|
|
int addType,
|
|
int isCoerced,
|
|
int remoteRight,
|
|
) =>
|
|
post(
|
|
editRemoteControlURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'remoteId': remoteId,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'remoteType': remoteType,
|
|
'weekDay': weekDay,
|
|
'remoteName': remoteName,
|
|
'addType': addType,
|
|
'isCoerced': isCoerced,
|
|
'remoteRight': remoteRight
|
|
}));
|
|
|
|
// 删除遥控
|
|
Future<Response> deletRemoteControlData(int remoteId) => post(
|
|
deleteRemoteControlURL.toUrl,
|
|
jsonEncode({
|
|
'remoteId': remoteId,
|
|
}));
|
|
|
|
// 重置遥控
|
|
Future<Response> resetRemoteControlData(int lockId) => post(
|
|
clearRemoteControlURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 校验遥控名字是否重复
|
|
Future<Response> checkRemoteControlNameDuplicatedData(
|
|
String lockId, String remoteName) =>
|
|
post(checkRemoteControlNameURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'remoteName': remoteName}));
|
|
|
|
// 获取掌静脉列表
|
|
Future<Response> getPalmListData(
|
|
String lockId, String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
getPalmListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr,
|
|
}));
|
|
|
|
// 添加掌静脉
|
|
Future<Response> addPalmData(
|
|
String lockId,
|
|
String palmVeinName,
|
|
String palmVeinNumber,
|
|
int palmVeinType,
|
|
int startDate,
|
|
int endDate,
|
|
int addType,
|
|
List weekDay,
|
|
int startTime,
|
|
int endTime,
|
|
int palmVeinRight) =>
|
|
post(
|
|
addPalmURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'palmVeinName': palmVeinName,
|
|
'palmVeinNumber': palmVeinNumber,
|
|
'palmVeinType': palmVeinType,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'addType': addType,
|
|
'weekDay': weekDay,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'palmVeinRight': palmVeinRight
|
|
}));
|
|
|
|
// 更新掌静脉序号
|
|
Future<Response> updatePalmUserNoLoadData(
|
|
int lockId, int palmVeinId, String palmVeinUserNo) =>
|
|
post(
|
|
updatePalmUserNoURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'palmVeinId': palmVeinId,
|
|
'palmVeinUserNo': palmVeinUserNo
|
|
}));
|
|
|
|
// 编辑掌静脉
|
|
Future<Response> editPalmData(
|
|
int lockId,
|
|
int palmVeinId,
|
|
int startDate,
|
|
int endDate,
|
|
int startTime,
|
|
int endTime,
|
|
int palmVeinType,
|
|
List weekDay,
|
|
String palmVeinName,
|
|
int addType,
|
|
int isCoerced,
|
|
int palmVeinRight,
|
|
) =>
|
|
post(
|
|
editPalmURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'palmVeinId': palmVeinId,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'palmVeinType': palmVeinType,
|
|
'weekDay': weekDay,
|
|
'palmVeinName': palmVeinName,
|
|
'addType': addType,
|
|
'isCoerced': isCoerced,
|
|
'palmVeinRight': palmVeinRight
|
|
}));
|
|
|
|
// 删除掌静脉
|
|
Future<Response> deletPalmData(int palmVeinId) => post(
|
|
deletePalmURL.toUrl,
|
|
jsonEncode({
|
|
'palmVeinId': palmVeinId,
|
|
}));
|
|
|
|
// 重置掌静脉
|
|
Future<Response> resetPalmData(int lockId) => post(
|
|
clearPalmURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 校验掌静脉名字是否重复
|
|
Future<Response> checkPalmNameDuplicatedData(
|
|
String lockId, String palmVeinName) =>
|
|
post(checkPalmNameURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'palmVeinName': palmVeinName}));
|
|
|
|
// 获取转移锁锁列表
|
|
Future<Response> getTransferLockListData(String searchStr) =>
|
|
post(transferLockListURL.toUrl, jsonEncode({'searchStr': searchStr}));
|
|
|
|
// 转移智能锁确认
|
|
Future<Response> transferLockConfirmInfoData(
|
|
String receiverUsername, String type, String countryCode) =>
|
|
post(
|
|
transferLockConfirmURL.toUrl,
|
|
jsonEncode({
|
|
'receiverUsername': receiverUsername,
|
|
'type': type,
|
|
'countryCode': countryCode
|
|
}));
|
|
|
|
// 转移智能锁
|
|
Future<Response> transferLockInfoData(
|
|
String receiverUsername, List lockIdList, String countryCode) =>
|
|
post(
|
|
transferLockURL.toUrl,
|
|
jsonEncode({
|
|
'receiverUsername': receiverUsername,
|
|
'lockIdList': lockIdList,
|
|
'countryCode': countryCode
|
|
}));
|
|
|
|
// 获取网关列表
|
|
Future<Response> getGatewayListData(
|
|
String pageNo, String pageSize, int timeout) =>
|
|
post(gatewaykListURL.toUrl,
|
|
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}),
|
|
timeout: timeout);
|
|
|
|
// 获取网关详情
|
|
Future<Response> getGatewayDetailData(int gatewayId, int timeout) =>
|
|
post(gatewayDetailURL.toUrl, jsonEncode({'gatewayId': gatewayId}),
|
|
timeout: timeout);
|
|
|
|
// 添加网关
|
|
Future<Response> addGatewayNetwork(
|
|
String gatewayName,
|
|
String gatewayMac,
|
|
String serialNumber,
|
|
int gatewayType,
|
|
String networkName,
|
|
String networkMac,
|
|
String version,
|
|
Map gatewayJson,
|
|
int timeout) =>
|
|
post(
|
|
addGatewayURL.toUrl,
|
|
jsonEncode({
|
|
'gatewayName': gatewayName,
|
|
'gatewayMac': gatewayMac,
|
|
'serialNumber': serialNumber,
|
|
'gatewayType': gatewayType,
|
|
'networkName': networkName,
|
|
'networkMac': networkMac,
|
|
'version': version,
|
|
'gatewayJson': gatewayJson,
|
|
}),
|
|
timeout: timeout);
|
|
|
|
// 删除网关
|
|
Future<Response> deletGateway(int gatewayId, int isForce, int timeout) =>
|
|
post(
|
|
deletGatewayURL.toUrl,
|
|
jsonEncode({
|
|
'gatewayId': gatewayId,
|
|
'isForce': isForce,
|
|
}),
|
|
timeout: timeout);
|
|
|
|
// 网关更新
|
|
Future<Response> gatewayUpdate(
|
|
int gatewayId, String gatewayName, int timeout) =>
|
|
post(
|
|
updateGatewayURL.toUrl,
|
|
jsonEncode({
|
|
'gatewayId': gatewayId,
|
|
'gatewayName': gatewayName,
|
|
}),
|
|
timeout: timeout);
|
|
|
|
// 远程开锁
|
|
Future<Response> remoteOpenLock(String lockId, int timeOut) => post(
|
|
remoteOpenLockURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}),
|
|
timeout: timeOut);
|
|
|
|
// 转移网关确认
|
|
Future<Response> transferGatewayConfirmInfoData(
|
|
String receiverUsername, String type, String countryCode) =>
|
|
post(
|
|
transferGatewayConfirmURL.toUrl,
|
|
jsonEncode({
|
|
'receiverUsername': receiverUsername,
|
|
'type': type,
|
|
'countryCode': countryCode
|
|
}));
|
|
|
|
// 转移网关
|
|
Future<Response> transferGatewayInfoData(
|
|
String receiverUsername, List plugIdList, String countryCode) =>
|
|
post(
|
|
transferGatewayURL.toUrl,
|
|
jsonEncode({
|
|
'receiverUsername': receiverUsername,
|
|
'plugIdList': plugIdList,
|
|
'countryCode': countryCode
|
|
}));
|
|
|
|
// 获取网关配置
|
|
Future<Response> getGatewayConfiguration(int timeout) =>
|
|
post(getGatewayConfigURL.toUrl, jsonEncode({}), timeout: timeout);
|
|
|
|
Future<Response> getGatewayConfigurationNotLoading(int timeout) =>
|
|
post(getGatewayConfigURL.toUrl, jsonEncode({}),
|
|
timeout: timeout, isUnShowLoading: true);
|
|
|
|
Future<Response> gatewayConnectionLockListLoadData(
|
|
int gatewayId, int timeout) =>
|
|
post(gatewayListByLockURL.toUrl, jsonEncode({'gatewayId': gatewayId}),
|
|
timeout: timeout);
|
|
|
|
Future<Response> gatewayScanDevice(int gatewayId, int timeout) =>
|
|
post(gatewayScanDeviceURL.toUrl, jsonEncode({'gatewayId': gatewayId}),
|
|
timeout: timeout);
|
|
|
|
// 移除坏锁
|
|
Future<Response> removeBrokenLockData(List lockIdList) =>
|
|
post(removeBadLockURL.toUrl, jsonEncode({'lockIds': lockIdList}));
|
|
|
|
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
|
listLockByGroupURL.toUrl,
|
|
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
|
|
|
Future<Response> getKeyDetail(String lockId) =>
|
|
post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}));
|
|
|
|
Future<Response> lockUserList(
|
|
String pageNo, String pageSize, String searchStr) =>
|
|
post(
|
|
lockUserListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr
|
|
}));
|
|
|
|
Future<Response> deletLockUser(int uid) => post(
|
|
deletLockUserURL.toUrl,
|
|
jsonEncode({
|
|
'uid': uid,
|
|
}));
|
|
|
|
Future<Response> keyListByUser(String pageNo, String pageSize, String uid) =>
|
|
post(keyListByUserURL.toUrl,
|
|
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}));
|
|
|
|
Future<Response> authorizedAdminList(String pageNo, String pageSize) => post(
|
|
authorizedAdminListURL.toUrl,
|
|
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}));
|
|
|
|
Future<Response> authorizedAdminDetail(int uid) =>
|
|
post(authorizedAdminDetailURL.toUrl, jsonEncode({'uid': uid}));
|
|
|
|
//获取授权管理员下锁列表
|
|
Future<Response> administratorOwnLockList(int uid) =>
|
|
post(administratorOwnLockListURL.toUrl, jsonEncode({'uid': uid}));
|
|
|
|
Future<Response> deleteAuthorizedAdmin(
|
|
String uid, String includeUnderlings) =>
|
|
post(deleteAdministratorURL.toUrl,
|
|
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
|
|
|
Future<Response> 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<Response> setAlertMode(String alertMode, String isOn) => post(
|
|
setAlertModeURL.toUrl,
|
|
jsonEncode({'alertMode': alertMode, 'isOn': isOn}));
|
|
|
|
Future<Response> changeSettings(String isOn, String type) =>
|
|
post(changeSettingsURL.toUrl, jsonEncode({'isOn': isOn, 'type': type}));
|
|
|
|
Future<Response> setTouchUnlockFlag(String isOn) =>
|
|
post(setTouchUnlockFlagURL.toUrl, jsonEncode({'isOn': isOn}));
|
|
|
|
Future<Response> userSettingsInfo() =>
|
|
post(userSettingsInfoURL.toUrl, jsonEncode({}));
|
|
|
|
Future<Response> canSendKey(String endDate, List lockIdList) => post(
|
|
canSendKeyURL.toUrl,
|
|
jsonEncode({'endDate': endDate, 'lockIdList': lockIdList}));
|
|
|
|
Future<Response> batchSendKey(
|
|
List lockIds,
|
|
int createUser,
|
|
String countryCode,
|
|
String receiverUsername,
|
|
String keyName,
|
|
int keyType,
|
|
List weekDays,
|
|
int startDate,
|
|
int endDate,
|
|
int startTime,
|
|
int endTime,
|
|
int remoteUnlockSwitch,
|
|
int keyRight,
|
|
bool isShowNetworkErrorMsg) =>
|
|
post(
|
|
batchSendKeyURL.toUrl,
|
|
jsonEncode({
|
|
'lockIds': lockIds,
|
|
'createUser': createUser,
|
|
'countryCode': countryCode,
|
|
'receiverUsername': receiverUsername,
|
|
'keyName': keyName,
|
|
'keyType': keyType,
|
|
'weekDays': weekDays,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
'startTime': startTime,
|
|
'endTime': endTime,
|
|
'remoteUnlockSwitch': remoteUnlockSwitch,
|
|
'keyRight': keyRight,
|
|
}),
|
|
isShowNetworkErrorMsg: isShowNetworkErrorMsg);
|
|
|
|
Future<Response> addAuthorizedAdmin(
|
|
String createUser,
|
|
String endDate,
|
|
String isRemoteUnlock,
|
|
List keyGroupIdList,
|
|
List lockIdList,
|
|
String name,
|
|
String startDate,
|
|
String userid,
|
|
String countryCode,
|
|
String usernameType,
|
|
int isOnlyManageSelf) =>
|
|
post(
|
|
addAuthorizedAdminURL.toUrl,
|
|
jsonEncode({
|
|
'createUser': createUser,
|
|
'endDate': endDate,
|
|
'isRemoteUnlock': isRemoteUnlock,
|
|
'keyGroupIdList': keyGroupIdList,
|
|
'lockIdList': lockIdList,
|
|
'name': name,
|
|
'startDate': startDate,
|
|
'userid': userid,
|
|
'countryCode': countryCode,
|
|
'usernameType': usernameType,
|
|
'isOnlyManageSelf': isOnlyManageSelf
|
|
}));
|
|
|
|
//退出登录
|
|
Future<Response> userLogout(String storageNonce) =>
|
|
post(userLogout3URL.toUrl, jsonEncode({'storageNonce': storageNonce}));
|
|
|
|
//删除账号
|
|
Future<Response> deleteAccount(
|
|
String channel, String verificationCode) =>
|
|
post(
|
|
deleteAccountURL.toUrl,
|
|
jsonEncode(
|
|
{'channel': channel, 'verificationCode': verificationCode}));
|
|
|
|
// 获取个人信息
|
|
Future<Response> getUserInfo(String operatorUid) =>
|
|
post(getUserInfoURL.toUrl, jsonEncode({'operatorUid': operatorUid}),
|
|
isUnShowLoading: true);
|
|
|
|
// 重置密码钥匙
|
|
Future<Response> keyboardPwdReset(String lockId, List passwordKey) => post(
|
|
keyboardPwdResetURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'passwordKey': passwordKey,
|
|
}));
|
|
|
|
//登陆后可使用获取验证码,免图片滑动验证
|
|
Future<Response> sendValidationCodeAuth(String countryCode, String account,
|
|
String channel, String codeType, String xWidth) =>
|
|
post(
|
|
sendValidationCodeAuthURL.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'channel': channel,
|
|
'codeType': codeType,
|
|
'xWidth': xWidth,
|
|
}));
|
|
|
|
//更新个人信息-昵称
|
|
Future<Response> updateUserNameInfo(String nickname) => post(
|
|
updateUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'nickname': nickname,
|
|
}));
|
|
|
|
//更新个人信息-头像
|
|
Future<Response> updateUserHeadUrlInfo(String headUrl) => post(
|
|
updateUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'headUrl': headUrl,
|
|
}));
|
|
|
|
//更新个人信息-国际化
|
|
Future<Response> updateUserLangInfo(String lang) => post(
|
|
updateUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'lang': lang,
|
|
}));
|
|
|
|
//更新个人信息-是否打开amazon alexa 0否 1是
|
|
Future<Response> updateUserInfoWithAlexa(int isAlexa) => post(
|
|
updateUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'is_amazon_alexa': isAlexa,
|
|
}));
|
|
|
|
//更新个人信息-是否打开google home 0否 1是
|
|
Future<Response> updateUserInfoWithGoogle(int isGoogle) => post(
|
|
updateUserInfoURL.toUrl,
|
|
jsonEncode({
|
|
'is_google_home': isGoogle,
|
|
}));
|
|
|
|
//修改绑定手机号
|
|
Future<Response> bindPhone(String countryCode, String account,
|
|
String verificationCode, String unbindToken) =>
|
|
post(
|
|
bindPhoneURL.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'verificationCode': verificationCode,
|
|
'unbindToken': unbindToken
|
|
}));
|
|
|
|
//修改绑定邮箱
|
|
Future<Response> bindEmail(
|
|
String email, String verificationCode, String unbindToken) =>
|
|
post(
|
|
bindEmailURL.toUrl,
|
|
jsonEncode({
|
|
'email': email,
|
|
'verificationCode': verificationCode,
|
|
'unbindToken': unbindToken
|
|
}));
|
|
|
|
//修改密码
|
|
Future<Response> changePassword(
|
|
String date, String newPassword, String oldPassword) =>
|
|
post(
|
|
changePasswordURL.toUrl,
|
|
jsonEncode({
|
|
'date': date,
|
|
'newPassword': newPassword,
|
|
'oldPassword': oldPassword,
|
|
}));
|
|
|
|
//获取安全信息列表
|
|
Future<Response> getQuestionList(String operatorUid, String countryCode) =>
|
|
post(
|
|
getQuestionListURL.toUrl,
|
|
jsonEncode({
|
|
'operatorUid': operatorUid,
|
|
'countryCode': countryCode,
|
|
}));
|
|
|
|
//获取已设置的安全信息
|
|
Future<Response> getOwnQuestionList() =>
|
|
post(getOwnQuestionListURL.toUrl, jsonEncode({}));
|
|
|
|
//设置安全信息
|
|
Future<Response> setSafeAnswer(List questionAndAnswerList) => post(
|
|
setSafeAnswerURL.toUrl,
|
|
jsonEncode({'questionAndAnswerList': questionAndAnswerList}));
|
|
|
|
//修改安全信息
|
|
Future<Response> updateSafeAnswer(List questionAndAnswerList) => post(
|
|
updateSafeAnswerURL.toUrl,
|
|
jsonEncode({'questionAndAnswerList': questionAndAnswerList}));
|
|
|
|
// 获取上传文件的upToken 再调用updateUserInfo
|
|
Future<Response> getUpHeadToken(
|
|
String userId,
|
|
String filename,
|
|
int size,
|
|
) =>
|
|
post(
|
|
getUpTokenURL.toUrl,
|
|
jsonEncode({
|
|
'module': 'avatar',
|
|
'userId': userId,
|
|
'filename': filename,
|
|
'size': size,
|
|
}));
|
|
|
|
// 文件上传
|
|
Future<Response> uploadFile(String url, dynamic boay) => post(url, boay,
|
|
isUnUploadFile: false,
|
|
contentType: 'multipart/form-data',
|
|
isUserBaseUrl: false);
|
|
|
|
//获取解绑手机号Token
|
|
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
|
unbindPhoneTokenURL.toUrl,
|
|
jsonEncode({'verificationCode': verificationCode}));
|
|
|
|
//获取解绑邮箱Token
|
|
Future<Response> unbindEmailToken(String verificationCode) => post(
|
|
unbindEmailTokenURL.toUrl,
|
|
jsonEncode({'verificationCode': verificationCode}));
|
|
|
|
//推送绑定DeviceID
|
|
Future<Response> pushBindAppId(String deviceId, int deviceType) => post(
|
|
pushBindAppIdURL.toUrl,
|
|
jsonEncode({'deviceId': deviceId, 'deviceType': deviceType}));
|
|
|
|
//推送channel绑定
|
|
Future<Response> pushBindChannels(
|
|
String storageNonce, List<Map<String, dynamic>> channels) =>
|
|
post(bindPushTokenURL.toUrl,
|
|
jsonEncode({'storageNonce': storageNonce, 'channels': channels}));
|
|
|
|
// 消息列表
|
|
Future<Response> messageListLoadData(String pageNo, String pageSize) => post(
|
|
messageListURL.toUrl,
|
|
jsonEncode({
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
// 读取消息
|
|
Future<Response> readMessageLoadData(String messageId) => post(
|
|
readMessageURL.toUrl,
|
|
jsonEncode({
|
|
'id': messageId,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 删除消息
|
|
Future<Response> deletMessageLoadData(String messageId) => post(
|
|
deletMessageURL.toUrl,
|
|
jsonEncode({
|
|
'id': messageId,
|
|
}));
|
|
|
|
// 删除所有消息
|
|
Future<Response> deletAllMessageLoadData() =>
|
|
post(deletAllMessageURL.toUrl, jsonEncode({}));
|
|
|
|
// 获取最新版本号
|
|
Future<Response> getVersionData(String brandName, String currentVersion) =>
|
|
post(
|
|
getVersionURL.toUrl,
|
|
jsonEncode({
|
|
'brandName': brandName,
|
|
'currentVersion': currentVersion,
|
|
}));
|
|
|
|
// 设置猫眼工作模式
|
|
Future<Response> updateCatEyeModeConfig(int lockId, List catEyeConfig) =>
|
|
post(
|
|
updateCatEyeConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'catEyeConfig': catEyeConfig,
|
|
}));
|
|
|
|
// 设置自动亮屏
|
|
Future<Response> updateAutoLightScreenConfig(
|
|
int lockId, int autoLightScreen) =>
|
|
post(
|
|
updateCatEyeConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'autoLightScreen': autoLightScreen,
|
|
}));
|
|
|
|
// 设置亮屏持续时间
|
|
Future<Response> updateLightScreenTimeConfig(
|
|
int lockId, int autoLightScreenTime) =>
|
|
post(
|
|
updateCatEyeConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'autoLightScreenTime': autoLightScreenTime,
|
|
}));
|
|
|
|
// 设置逗留警告
|
|
Future<Response> updateStayWarnConfig(int lockId, int stayWarn) => post(
|
|
updateCatEyeConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'stayWarn': stayWarn,
|
|
}));
|
|
|
|
// 设置异常警告
|
|
Future<Response> updateAbnormalWarnConfig(int lockId, int abnormalWarn) =>
|
|
post(
|
|
updateCatEyeConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'abnormalWarn': abnormalWarn,
|
|
}));
|
|
|
|
// 设置面容开锁
|
|
Future<Response> updateFaceSwitch(int lockId, int faceSwitch) => post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceSwitch': faceSwitch,
|
|
}));
|
|
|
|
// 设置面容感应距离
|
|
Future<Response> updateFaceSenseDistance(
|
|
int lockId, int faceInductionDistance) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceInductionDistance': faceInductionDistance,
|
|
}));
|
|
|
|
// 设置面容防误开
|
|
Future<Response> updateFacePreventMisrun(int lockId, int faceEnErrUnlock) =>
|
|
post(
|
|
updateLockSettingUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceEnErrUnlock': faceEnErrUnlock,
|
|
}));
|
|
|
|
// 设置面容自动亮屏
|
|
Future<Response> updateFaceAutoLightScreen(
|
|
int lockId, int faceAutoLightScreen) =>
|
|
post(
|
|
updateFaceConfigURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'faceAutoLightScreen': faceAutoLightScreen,
|
|
}));
|
|
|
|
// 获取锁消息设置
|
|
Future<Response> getLockNoticeSetting(int lockId) => post(
|
|
getLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 设置N天未开门
|
|
Future<Response> updateNdaysNotCloseDoorNoticeSetting(
|
|
int lockId,
|
|
int dayNotOpenDoorState,
|
|
int dayNotOpenDoorValue,
|
|
List dayNotOpenDoorNoticeWayList) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'dayNotOpenDoorState': dayNotOpenDoorState,
|
|
'dayNotOpenDoorValue': dayNotOpenDoorValue,
|
|
'dayNotOpenDoorNoticeWayList': dayNotOpenDoorNoticeWayList
|
|
}));
|
|
|
|
// 设置低电量提醒
|
|
Future<Response> updatelowElecNoticeStateSetting(
|
|
int lockId, int lowElecNoticeState, List lowElecNoticeWayList) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'lowElecNoticeState': lowElecNoticeState,
|
|
'lowElecNoticeWayList': lowElecNoticeWayList
|
|
}));
|
|
|
|
// 设置门未关好
|
|
Future<Response> updateDoorNotCloseSetting(
|
|
int lockId,
|
|
int doorNotCloseState,
|
|
) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'doorNotCloseState': doorNotCloseState,
|
|
}));
|
|
|
|
// 设置有人按门铃状态
|
|
Future<Response> updateDoorbellNoticeStateSetting(
|
|
int lockId,
|
|
int doorbellNoticeState,
|
|
) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'doorbellNoticeState': doorbellNoticeState,
|
|
}));
|
|
|
|
// 设置有人出现在门口
|
|
Future<Response> updateSomeoneAtDoorNoticeStateSetting(
|
|
int lockId,
|
|
int someoneAtDoorNoticeState,
|
|
) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'someoneAtDoorNoticeState': someoneAtDoorNoticeState,
|
|
}));
|
|
|
|
// 设置防拆报警通知
|
|
Future<Response> updaTetamperAlarmStateSetting(
|
|
int lockId,
|
|
int tamperAlarmState,
|
|
) =>
|
|
post(
|
|
updateLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'tamperAlarmState': tamperAlarmState,
|
|
}));
|
|
|
|
// 锁用户列表
|
|
Future<Response> getLockKeysList(int lockId, String searchStr) => post(
|
|
lockKeysListURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'searchStr': searchStr}));
|
|
|
|
// 添加开门通知
|
|
Future<Response> addLockNoticeSetting(
|
|
int lockId, int noticeType, Map settingValue) =>
|
|
post(
|
|
addLockNoticeSettingURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'noticeType': noticeType,
|
|
'settingValue': settingValue
|
|
}));
|
|
|
|
// 开门通知列表
|
|
Future<Response> lockNoticeSettingAccountList(int lockId, int noticeType) =>
|
|
post(lockNoticeSettingListURL.toUrl,
|
|
jsonEncode({'lockId': lockId, 'noticeType': noticeType}));
|
|
|
|
// 删除开门通知
|
|
Future<Response> deleteLockNoticeSettingAccount(
|
|
int lockNoticeSettingAccountId) =>
|
|
post(
|
|
deleteLockNoticeSettingAccountURL.toUrl,
|
|
jsonEncode(
|
|
{'lockNoticeSettingAccountId': lockNoticeSettingAccountId}));
|
|
|
|
// 更新开门通知
|
|
Future<Response> updateLockNoticeSettingAccount(
|
|
int lockNoticeSettingAccountId, Map settingValue) =>
|
|
post(
|
|
updateLockNoticeSettingAccountURL.toUrl,
|
|
jsonEncode({
|
|
'lockNoticeSettingAccountId': lockNoticeSettingAccountId,
|
|
'settingValue': settingValue
|
|
}));
|
|
|
|
// 获取胁迫指纹列表
|
|
Future<Response> getCoercedFingerprintList(
|
|
int lockId, int pageNo, int pageSize, String searchStr) =>
|
|
post(
|
|
getCoercedFingerprintListURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
'searchStr': searchStr
|
|
}));
|
|
|
|
// 获取云存列表
|
|
Future<Response> getValidityPeriodInfo(
|
|
int lockId, {
|
|
String request_method = 'POST',
|
|
String request_uri = '/api/v1/cloudStorage/getStorageServiceInfo',
|
|
required Map<String, dynamic> post_args,
|
|
}) =>
|
|
post(
|
|
getValidityPeriodInfoURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'request_method': request_method,
|
|
'request_uri': request_uri,
|
|
'post_args': post_args,
|
|
}));
|
|
|
|
// 获取云存列表
|
|
Future<Response> getLockCloudStorageList(int lockId) =>
|
|
post(getlockCloudStorageListURL.toUrl, jsonEncode({'lockId': lockId}));
|
|
|
|
// 删除云存列表
|
|
Future<Response> deleteLockCloudStorageList(List recordIds) => post(
|
|
deleteLockCloudStorageURL.toUrl, jsonEncode({'recordIds': recordIds}));
|
|
|
|
// 设置微信公众号推送
|
|
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
|
setWechatPushSwitchURL.toUrl,
|
|
jsonEncode({
|
|
'mpWechatPushSwitch': mpWechatPushSwitch,
|
|
}));
|
|
|
|
// 获取微信公众号二维码
|
|
Future<Response> getMpWechatQrCode() =>
|
|
post(getMpWechatQrCodeURL.toUrl, jsonEncode({}));
|
|
|
|
// 设置实名认证频次
|
|
Future<Response> setFaceAuthentication(int faceAuthFrequence) => post(
|
|
setFaceAuthenticationURL.toUrl,
|
|
jsonEncode({
|
|
'face_auth_frequence': faceAuthFrequence,
|
|
}));
|
|
|
|
// 获取购买记录列表
|
|
Future<Response> getBuyRecordList(
|
|
String type, int recordType, int pageNo, int pageSize) =>
|
|
post(
|
|
getBuyRecordListURL.toUrl,
|
|
jsonEncode({
|
|
'type': type,
|
|
'record_type': recordType,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
// 获取使用记录列表
|
|
Future<Response> getUseRecordList(String type, int pageNo, int pageSize) =>
|
|
post(
|
|
getUseRecordListURL.toUrl,
|
|
jsonEncode({
|
|
'type': type,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize,
|
|
}));
|
|
|
|
// 增值服务套餐购包链接
|
|
Future<Response> getServicePackageBuyUrl() =>
|
|
post(getServicePackageURL.toUrl, jsonEncode({}));
|
|
|
|
// 获取增值服务用户余量包
|
|
Future<Response> getServiceUserPackage() =>
|
|
post(getServiceUserPackageURL.toUrl, jsonEncode({}));
|
|
|
|
// 检测实名认证是否支持开启
|
|
Future<Response> keyCheckFace(
|
|
int lockId,
|
|
) =>
|
|
post(
|
|
isFaceAuthenticationURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
}));
|
|
|
|
// 获取人脸认证certifyId
|
|
Future<Response> getFaceCertifyId(
|
|
int lockId,
|
|
int keyId,
|
|
Map metaInfo,
|
|
) =>
|
|
post(
|
|
getFaceCertifyIdURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'metaInfo': metaInfo,
|
|
}));
|
|
|
|
// 检测certifyId是否完成认证
|
|
Future<Response> getServiceCheckCertify(
|
|
String certifyId,
|
|
int keyId,
|
|
) =>
|
|
post(
|
|
getServiceCheckCertifyURL.toUrl,
|
|
jsonEncode({
|
|
'certifyId': certifyId,
|
|
'keyId': keyId,
|
|
}));
|
|
|
|
// 获取指定锁下所有userNo
|
|
Future<Response> getLockUserNoList(int lockId) =>
|
|
post(getUserNoList.toUrl, jsonEncode({'lockId': lockId}));
|
|
|
|
// 锁数据上传
|
|
Future<Response> lockDataUpload(
|
|
int lockId,
|
|
int uploadType,
|
|
int recordType,
|
|
List records,
|
|
bool isUnShowLoading,
|
|
) =>
|
|
post(
|
|
lockDataUploadUrl.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'uploadType': uploadType,
|
|
'recordType': recordType,
|
|
'records': records
|
|
}),
|
|
isUnShowLoading: isUnShowLoading);
|
|
|
|
// 获取短信或者邮箱模板
|
|
Future<Response<dynamic>> getNoticeTemplate(
|
|
int lockId, int keyId, int channelType) =>
|
|
post(
|
|
getNoticeTemplateURL.toUrl,
|
|
jsonEncode(<String, int>{
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'channelType': channelType,
|
|
}));
|
|
|
|
// 获取App基本信息
|
|
Future<Response<dynamic>> getAppInfo() =>
|
|
post(appGetAppInfoURL.toUrl, jsonEncode(<String, int>{}),
|
|
isShowErrMsg: false, isUnShowLoading: true);
|
|
|
|
// 获取App固件信息
|
|
Future<Response<dynamic>> getFwVersion(String model, String currentVersion) =>
|
|
post(
|
|
appGetFwVersionURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'model': model,
|
|
'currentVersion': currentVersion,
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
// 获取默认模板
|
|
Future<Response<dynamic>> getDefaultTemplate() => post(
|
|
getDefaultTemplateURL.toUrl,
|
|
jsonEncode(<String, dynamic>{}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
// 获取短信模板列表
|
|
Future<Response<dynamic>> getSMSTemplateList(
|
|
int channelType, int pageNo, int pageSize) =>
|
|
post(
|
|
haveTemplateListURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'channelType': channelType,
|
|
'pageNo': pageNo,
|
|
'pageSize': pageSize
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
// 添加短信模板
|
|
Future<Response<dynamic>> addTemplateService(int channelType, String name,
|
|
int langType, String regards, String tips, int templateType) =>
|
|
post(
|
|
addTemplateServiceURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'channelType': channelType,
|
|
'name': name,
|
|
'langType': langType,
|
|
'regards': regards,
|
|
'tips': tips,
|
|
'templateType': templateType
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> updateTemplateInfo(
|
|
int id, String name, String regards, String tips) =>
|
|
post(
|
|
updateTemplateInfoURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'id': id,
|
|
'name': name,
|
|
'regards': regards,
|
|
'tips': tips,
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> deleteTemplateInfo(int id) => post(
|
|
deleteTemplateURL.toUrl,
|
|
jsonEncode(<String, dynamic>{'id': id}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> checkIpAction(String ip) => post(
|
|
checkIpURL.toUrl,
|
|
jsonEncode(<String, dynamic>{'ip': ip}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> getKeyNoticeTemplate(
|
|
int lockId, int keyId, int channelType) =>
|
|
post(
|
|
keyNoticeTemplateURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'channelType': channelType,
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> getPwdNoticeTemplate(
|
|
int lockId, int keyboardPwdId, int channelType) =>
|
|
post(
|
|
keyNoticeTemplateURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'lockId': lockId,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'channelType': channelType,
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> keyNoticeSubmit(
|
|
String receiverName,
|
|
int lockId,
|
|
int keyId,
|
|
int channelType,
|
|
int openDoorType,
|
|
String templateType,
|
|
int countryCode) =>
|
|
post(
|
|
keyNoticeSubmitURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'receiverName': receiverName,
|
|
'lockId': lockId,
|
|
'keyId': keyId,
|
|
'channelType': channelType,
|
|
'openDoorType': openDoorType,
|
|
'templateType': templateType,
|
|
'countryCode': countryCode
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> pwdNoticeSubmit(
|
|
String receiverName,
|
|
int lockId,
|
|
int keyboardPwdId,
|
|
int channelType,
|
|
int openDoorType,
|
|
String templateType,
|
|
int countryCode) =>
|
|
post(
|
|
keyNoticeSubmitURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'receiverName': receiverName,
|
|
'lockId': lockId,
|
|
'keyboardPwdId': keyboardPwdId,
|
|
'channelType': channelType,
|
|
'openDoorType': openDoorType,
|
|
'templateType': templateType,
|
|
'countryCode': countryCode
|
|
}),
|
|
isUnShowLoading: true,
|
|
);
|
|
|
|
Future<Response<dynamic>> getLockUpdateLockInfo(
|
|
int lockId,
|
|
String fwVersion,
|
|
) =>
|
|
post(
|
|
lockUpdateLockInfo.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'lockId': lockId,
|
|
'fwVersion': fwVersion,
|
|
}),
|
|
);
|
|
|
|
Future<Response<dynamic>> exportLockRecords(
|
|
int lockId,
|
|
int startDate,
|
|
int endDate,
|
|
) =>
|
|
post(
|
|
exportLockRecordsURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'lockId': lockId,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
}),
|
|
);
|
|
|
|
Future<Response<dynamic>> batchExportLockRecords(
|
|
List<int> lockIds,
|
|
int startDate,
|
|
int endDate,
|
|
) =>
|
|
post(
|
|
exportLockRecordsURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'lockIds': lockIds,
|
|
'startDate': startDate,
|
|
'endDate': endDate,
|
|
}),
|
|
);
|
|
|
|
// 获取锁信息列表
|
|
Future<Response> updateZoneOffsetsAndLanguages(
|
|
int timezoneOffset,
|
|
// String language
|
|
) =>
|
|
post(
|
|
updateZoneOffsetsAndLanguagesURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'timezone_offset': timezoneOffset,
|
|
// 'language': language,
|
|
}),
|
|
isUnShowLoading: true);
|
|
|
|
// 绑定星图配置
|
|
Future<Response> bindUserStarchart(
|
|
String starchartId,
|
|
String starchartPeerPublicKey,
|
|
String starchartPeerPrivateKey,
|
|
) =>
|
|
post(
|
|
bindUserStarchartURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'starchartId': starchartId,
|
|
'starchartPeerPublicKey': starchartPeerPublicKey,
|
|
'starchartPeerPrivateKey': starchartPeerPrivateKey,
|
|
}),
|
|
isUnShowLoading: true,
|
|
isShowNetworkErrorMsg: false);
|
|
|
|
/// 更新网络信息 配网之后把网络信息提交到服务器保存
|
|
Future<Response> settingDeviceNetwork(
|
|
int deviceType,
|
|
String deviceMac,
|
|
String wifiName,
|
|
String networkMac,
|
|
String secretKey,
|
|
String peerId,
|
|
) =>
|
|
post(
|
|
deviceNetworkConfiguration.toUrl,
|
|
jsonEncode({
|
|
'deviceType': deviceType,
|
|
'deviceMac': deviceMac,
|
|
'wifiName': wifiName,
|
|
'networkMac': networkMac,
|
|
'secretKey': secretKey,
|
|
'peerId': peerId,
|
|
}));
|
|
|
|
/// 获取设备配网信息
|
|
Future<Response> getDeviceNetwork(
|
|
int deviceType,
|
|
String deviceMac,
|
|
) =>
|
|
post(
|
|
getDeviceNetworkConfiguration.toUrl,
|
|
jsonEncode({
|
|
'deviceType': deviceType,
|
|
'deviceMac': deviceMac,
|
|
}),
|
|
isShowNetworkErrorMsg: false,
|
|
isShowErrMsg: false,
|
|
isUnShowLoading: true);
|
|
|
|
/// 获取设备配网信息
|
|
Future<Response> getPassthroughList(
|
|
String requestMethod,
|
|
String requestUri,
|
|
Map<String, String> data,
|
|
) =>
|
|
post(
|
|
getPassthroughListURL.toUrl,
|
|
jsonEncode({
|
|
'request_method': requestMethod,
|
|
'request_uri': requestUri,
|
|
'post_args': data,
|
|
}),
|
|
isShowNetworkErrorMsg: false,
|
|
isShowErrMsg: false,
|
|
isUnShowLoading: true);
|
|
|
|
/// 设置语音包
|
|
Future<Response> settingCurrentVoiceTimbre(
|
|
int lockId,
|
|
Map<String, String> data,
|
|
) =>
|
|
post(
|
|
updateCurrentVoiceTimbre.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'currentVoiceTimbre': data,
|
|
}),
|
|
isShowNetworkErrorMsg: false,
|
|
isShowErrMsg: false,
|
|
isUnShowLoading: true);
|
|
|
|
/// 设置语音包
|
|
Future<Response> reportBuyRequest(
|
|
int lockId,
|
|
String type,
|
|
) =>
|
|
post(
|
|
reportBuyRequestURL.toUrl,
|
|
jsonEncode({
|
|
'lockId': lockId,
|
|
'type': type,
|
|
}),
|
|
isShowNetworkErrorMsg: false,
|
|
isShowErrMsg: false,
|
|
isUnShowLoading: true);
|
|
}
|
|
|
|
extension ExtensionString on String {
|
|
String get toUrl => this;
|
|
}
|