2023-07-27 15:29:37 +08:00
|
|
|
|
import 'package:get/get.dart';
|
2024-01-23 17:48:06 +08:00
|
|
|
|
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
2023-08-17 18:54:19 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
2023-08-16 17:35:43 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
2023-09-11 09:48:47 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
2023-09-07 18:32:56 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
2024-01-24 18:51:18 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
|
2024-01-23 17:34:37 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
2023-08-23 14:27:50 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
2023-08-25 17:06:42 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
2024-01-25 15:43:10 +08:00
|
|
|
|
import 'package:star_lock/mine/mall/lockMall_entity.dart';
|
2023-10-11 18:24:52 +08:00
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_entity.dart';
|
|
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
|
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoSetSafetyProblem/minePersonInfoSetSafetyProblem_entity.dart';
|
|
|
|
|
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoViewSafetyProblem/minePersonInfoViewSafetyProblem_entity.dart';
|
2023-09-25 14:29:57 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/appUnlockNeedMobileNetworkingLock/selectLockListEntity.dart';
|
2023-09-22 11:45:24 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
2023-09-15 09:43:20 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
2023-09-19 10:53:41 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
2023-11-03 13:58:41 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
2023-09-26 11:47:36 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
2023-07-29 18:33:48 +08:00
|
|
|
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
|
|
|
|
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
2023-07-29 09:25:21 +08:00
|
|
|
|
import '../login/login/entity/LoginEntity.dart';
|
2023-08-02 09:22:39 +08:00
|
|
|
|
import '../login/register/entity/SendValidationCodeEntity.dart';
|
2023-09-25 14:27:23 +08:00
|
|
|
|
import '../main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import '../main/lockDetail/card/addICCard/addICCard_entity.dart';
|
2023-09-15 16:04:11 +08:00
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart';
|
2024-01-23 17:29:18 +08:00
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
|
2023-09-15 16:04:11 +08:00
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import '../main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
2024-01-23 17:34:37 +08:00
|
|
|
|
import '../main/lockDetail/lockSet/configuringWifi/configuringWifiEntity.dart';
|
|
|
|
|
|
import '../main/lockDetail/lockSet/lockSet/checkingInInfoData_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/lockSet/lockTime/getServerDatetime_entity.dart';
|
2023-11-24 14:23:36 +08:00
|
|
|
|
import '../main/lockDetail/lockDetail/lockNetToken_entity.dart';
|
2023-09-28 18:05:23 +08:00
|
|
|
|
import '../main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
2023-11-01 17:28:59 +08:00
|
|
|
|
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
2023-08-24 14:25:55 +08:00
|
|
|
|
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
2024-01-24 18:44:34 +08:00
|
|
|
|
import '../mine/message/messageList/messageList_entity.dart';
|
2023-11-24 14:23:36 +08:00
|
|
|
|
import '../mine/minePersonInfo/minePersonInfoPage/minePersonGetUploadFileInfo_entity.dart';
|
2023-09-22 16:06:08 +08:00
|
|
|
|
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
|
|
|
|
|
|
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
|
|
|
|
|
|
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
|
2023-07-27 15:29:37 +08:00
|
|
|
|
import 'api_provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ApiRepository {
|
|
|
|
|
|
final ApiProvider apiProvider;
|
|
|
|
|
|
|
|
|
|
|
|
static ApiRepository get to => Get.find<ApiRepository>();
|
|
|
|
|
|
ApiRepository(this.apiProvider);
|
|
|
|
|
|
|
2023-08-07 10:32:24 +08:00
|
|
|
|
// 发送验证码 1注册,2找回密码,3绑定手机号,4解绑(换绑),5删除账号
|
2023-08-02 09:22:39 +08:00
|
|
|
|
Future<SendValidationCodeEntity> sendValidationCode(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String account,
|
|
|
|
|
|
String channel,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String codeType,
|
2023-08-02 09:22:39 +08:00
|
|
|
|
String uniqueid,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String xWidth) async {
|
|
|
|
|
|
final res = await apiProvider.getVerificationCode(
|
|
|
|
|
|
countryCode, account, channel, codeType, uniqueid, xWidth);
|
2023-08-02 09:22:39 +08:00
|
|
|
|
return SendValidationCodeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 注册
|
|
|
|
|
|
Future<LoginEntity> register(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String countryId,
|
|
|
|
|
|
String mobile,
|
|
|
|
|
|
String password,
|
|
|
|
|
|
String uniqueid,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.register(
|
|
|
|
|
|
countryCode, countryId, mobile, password, uniqueid, verificationCode);
|
2023-07-29 09:25:21 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
|
// 获取图片验证码
|
|
|
|
|
|
Future<SafetyVerificationEntity> getSliderVerifyImg(
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String countryCode, String account) async {
|
2023-07-29 18:33:48 +08:00
|
|
|
|
final res = await apiProvider.getSliderVerifyImg(countryCode, account);
|
|
|
|
|
|
return SafetyVerificationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
|
// 检验图片验证码
|
|
|
|
|
|
Future<CheckSafetyVerificationEntity> checkSliderVerifyImg(
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String countryCode, String account, String xWidth) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.checkSliderVerifyImg(countryCode, account, xWidth);
|
2023-07-29 18:33:48 +08:00
|
|
|
|
return CheckSafetyVerificationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-16 17:35:43 +08:00
|
|
|
|
//登录
|
2023-08-07 10:32:24 +08:00
|
|
|
|
Future<LoginEntity> login(String loginType, String password,
|
|
|
|
|
|
String countryCode, String username) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.login(loginType, password, countryCode, username);
|
2023-08-02 09:22:39 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-07-27 15:29:37 +08:00
|
|
|
|
|
2023-08-07 10:32:24 +08:00
|
|
|
|
//重置密码
|
|
|
|
|
|
Future<LoginEntity> resetPassword(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String account,
|
|
|
|
|
|
String date,
|
|
|
|
|
|
String newPassword,
|
|
|
|
|
|
String uniqueid,
|
|
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.resetPassword(
|
|
|
|
|
|
countryCode, account, date, newPassword, uniqueid, verificationCode);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-16 17:35:43 +08:00
|
|
|
|
|
|
|
|
|
|
//获取国家或地区 json文件
|
2023-08-23 14:27:50 +08:00
|
|
|
|
Future<CountryRegionEntity> getCountryRegion(String type) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.getCountryRegion(type);
|
2023-08-23 14:27:50 +08:00
|
|
|
|
return CountryRegionEntity.fromJson(res.body);
|
2023-08-16 17:35:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//电子钥匙列表
|
|
|
|
|
|
Future<ElectronicKeyListEntity> electronicKeyList(
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyStatus,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String pageNo,
|
|
|
|
|
|
String pageSize,
|
2023-08-23 14:27:50 +08:00
|
|
|
|
String startDate,
|
2023-10-18 16:20:46 +08:00
|
|
|
|
String keyRight,
|
|
|
|
|
|
String searchStr) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
2023-10-18 16:20:46 +08:00
|
|
|
|
lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr);
|
2023-08-16 17:35:43 +08:00
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//发送电子钥匙
|
2023-09-25 14:27:23 +08:00
|
|
|
|
Future<AuthorizedAdminSendEntity> sendElectronicKey(
|
2023-10-16 17:18:10 +08:00
|
|
|
|
{required String createUser,
|
|
|
|
|
|
required String countryCode,
|
|
|
|
|
|
required String usernameType,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String faceAuthentication,
|
|
|
|
|
|
required String isCameraEnable,
|
|
|
|
|
|
required String isRemoteUnlock,
|
|
|
|
|
|
required String keyNameForAdmin,
|
|
|
|
|
|
required String keyRight,
|
|
|
|
|
|
required String keyType,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String operatorUid,
|
|
|
|
|
|
required String receiverUsername,
|
|
|
|
|
|
required String remarks,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required List weekDays}) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.sendElectronicKey(
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
countryCode,
|
|
|
|
|
|
usernameType,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
faceAuthentication,
|
|
|
|
|
|
isCameraEnable,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyNameForAdmin,
|
|
|
|
|
|
keyRight,
|
|
|
|
|
|
keyType,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
receiverUsername,
|
|
|
|
|
|
remarks,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
weekDays);
|
2023-09-25 14:27:23 +08:00
|
|
|
|
return AuthorizedAdminSendEntity.fromJson(res.body);
|
2023-08-16 17:35:43 +08:00
|
|
|
|
}
|
2023-08-17 18:54:19 +08:00
|
|
|
|
|
|
|
|
|
|
//重置电子钥匙
|
|
|
|
|
|
Future<ElectronicKeyListEntity> resetElectronicKey(
|
|
|
|
|
|
String lockId, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.resetElectronicKey(lockId, operatorUid);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//钥匙详情-操作记录
|
|
|
|
|
|
Future<KeyOperationRecordEntity> lockRecordList(
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyStatus,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String pageNo,
|
|
|
|
|
|
String pageSize,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String recordType,
|
|
|
|
|
|
String searchStr,
|
2023-08-31 14:40:50 +08:00
|
|
|
|
String timezoneRawOffSet,
|
|
|
|
|
|
String keyboardPwdId,
|
|
|
|
|
|
String cardId,
|
|
|
|
|
|
String fingerprintId) async {
|
2023-08-17 18:54:19 +08:00
|
|
|
|
final res = await apiProvider.lockRecordList(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
keyId,
|
|
|
|
|
|
keyStatus,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
pageNo,
|
|
|
|
|
|
pageSize,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
recordType,
|
|
|
|
|
|
searchStr,
|
2023-08-31 14:40:50 +08:00
|
|
|
|
timezoneRawOffSet,
|
|
|
|
|
|
keyboardPwdId,
|
|
|
|
|
|
cardId,
|
|
|
|
|
|
fingerprintId);
|
2023-08-17 18:54:19 +08:00
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-24 14:25:55 +08:00
|
|
|
|
|
2023-09-28 18:05:23 +08:00
|
|
|
|
//操作记录上传
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<KeyOperationRecordEntity> lockRecordUploadData(
|
|
|
|
|
|
{required String lockId, required List records}) async {
|
2023-10-09 18:45:10 +08:00
|
|
|
|
final res = await apiProvider.lockRecordUploadData(lockId, records);
|
2023-09-28 18:05:23 +08:00
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查询锁记录最后时间
|
2023-10-09 18:45:10 +08:00
|
|
|
|
Future<LockOperatingRecordGetLastRecordTimeEntity>
|
|
|
|
|
|
getLockRecordLastUploadDataTime({required String lockId}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockRecordLastUploadDataTime(lockId);
|
2023-09-28 18:05:23 +08:00
|
|
|
|
return LockOperatingRecordGetLastRecordTimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 获取手机联网token
|
|
|
|
|
|
Future<LockNetTokenEntity> getLockNetToken({required String lockId}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockNetToken(lockId);
|
|
|
|
|
|
return LockNetTokenEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-16 11:20:36 +08:00
|
|
|
|
// 更新锁用户NO
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<LockNetTokenEntity> updateLockUserNo(
|
|
|
|
|
|
{required String keyId, required String lockUserNo}) async {
|
2023-12-16 11:20:36 +08:00
|
|
|
|
final res = await apiProvider.updateLockUserNo(keyId, lockUserNo);
|
|
|
|
|
|
return LockNetTokenEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// 绑定蓝牙管理员
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<SaveLockEntity> bindingBlueAdmin(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String lockAlias,
|
|
|
|
|
|
required Map position,
|
|
|
|
|
|
required Map bluetooth,
|
|
|
|
|
|
required Map lockInfo,
|
|
|
|
|
|
required String lockUserNo,
|
|
|
|
|
|
required String pwdTimestamp,
|
|
|
|
|
|
required String featureValue,
|
|
|
|
|
|
required String featureSettingValue,
|
|
|
|
|
|
required List featureSettingParams}) async {
|
2023-09-04 11:11:14 +08:00
|
|
|
|
final res = await apiProvider.bindingBlueAdmin(
|
|
|
|
|
|
lockAlias,
|
|
|
|
|
|
position,
|
|
|
|
|
|
bluetooth,
|
2023-11-01 17:28:59 +08:00
|
|
|
|
lockInfo,
|
2023-09-07 18:36:16 +08:00
|
|
|
|
lockUserNo,
|
2023-11-01 17:28:59 +08:00
|
|
|
|
pwdTimestamp,
|
|
|
|
|
|
featureValue,
|
|
|
|
|
|
featureSettingValue,
|
|
|
|
|
|
featureSettingParams);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
return SaveLockEntity.fromJson(res.body);
|
2023-08-24 14:34:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-18 18:25:58 +08:00
|
|
|
|
//锁电量更新
|
|
|
|
|
|
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
|
|
|
|
|
String electricQuantity, String lockId) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.uploadElectricQuantity(electricQuantity, lockId);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//锁名称修改
|
|
|
|
|
|
Future<KeyOperationRecordEntity> modifyKeyName(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String keyId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String keyName}) async {
|
|
|
|
|
|
final res = await apiProvider.modifyKeyName(keyId, lockId, keyName);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//修改锁名(新)
|
|
|
|
|
|
Future<KeyOperationRecordEntity> updateLockName(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String lockId, required String lockName}) async {
|
|
|
|
|
|
final res = await apiProvider.updateLockName(lockId, lockName);
|
2023-08-18 18:25:58 +08:00
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-23 14:27:50 +08:00
|
|
|
|
|
|
|
|
|
|
//编辑电子钥匙名字
|
|
|
|
|
|
Future<KeyOperationRecordEntity> modifyKeyNameForAdmin(
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyNameForAdmin,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.modifyKeyNameForAdmin(
|
|
|
|
|
|
keyId, keyNameForAdmin, operatorUid);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-04 11:11:14 +08:00
|
|
|
|
//编辑电子钥匙有效期
|
|
|
|
|
|
Future<KeyOperationRecordEntity> updateKeyDate(
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String endDay,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String startDay,
|
|
|
|
|
|
List weekDays) async {
|
|
|
|
|
|
final res = await apiProvider.updateKeyDate(keyId, lockId, endDate, endDay,
|
|
|
|
|
|
operatorUid, startDate, startDay, weekDays);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//密码列表
|
2024-01-02 15:32:56 +08:00
|
|
|
|
Future<PasswordKeyListEntity> passwordKeyList(String keyStatus, String lockId,
|
|
|
|
|
|
String pageNo, String pageSize, String searchStr) async {
|
2023-08-23 14:27:50 +08:00
|
|
|
|
final res = await apiProvider.passwordKeyList(
|
2024-01-02 15:32:56 +08:00
|
|
|
|
keyStatus, lockId, pageNo, pageSize, searchStr);
|
2023-08-23 14:27:50 +08:00
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//重置密码钥匙
|
|
|
|
|
|
Future<PasswordKeyListEntity> resetPasswordKey(
|
|
|
|
|
|
String lockId, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.resetPasswordKey(lockId, operatorUid);
|
|
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
}
|
2023-08-26 11:40:40 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取锁信息
|
2023-11-01 17:28:59 +08:00
|
|
|
|
// Future<LockMainEntity> getLockInfo(
|
|
|
|
|
|
// {required String lastUpdateDate, required String pageNo}) async {
|
|
|
|
|
|
// final res = await apiProvider.getLockInfo(lastUpdateDate, pageNo);
|
|
|
|
|
|
// return LockMainEntity.fromJson(res.body);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 获取锁信息列表
|
|
|
|
|
|
Future<LockListInfoEntity> getStarLockListInfo(
|
|
|
|
|
|
{required int pageNo, required int pageSize}) async {
|
|
|
|
|
|
final res = await apiProvider.getStarLockListInfo(pageNo, pageSize);
|
|
|
|
|
|
return LockListInfoEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有锁设置信息
|
2024-01-02 15:32:56 +08:00
|
|
|
|
Future<LockSetInfoEntity> getLockSettingInfoData(
|
|
|
|
|
|
{required String lockId}) async {
|
2023-11-01 17:28:59 +08:00
|
|
|
|
final res = await apiProvider.getLockSettingInfoData(lockId);
|
|
|
|
|
|
return LockSetInfoEntity.fromJson(res.body);
|
2023-08-26 11:40:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-29 17:39:35 +08:00
|
|
|
|
// 删除锁
|
2024-01-02 15:32:56 +08:00
|
|
|
|
Future<LockListInfoEntity> deletOwnerLockData(
|
|
|
|
|
|
{required String lockId}) async {
|
2023-08-29 17:39:35 +08:00
|
|
|
|
final res = await apiProvider.deletLockInfo(lockId);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LockListInfoEntity.fromJson(res.body);
|
2023-08-29 17:39:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 09:14:34 +08:00
|
|
|
|
// 删除钥匙
|
2024-01-02 15:32:56 +08:00
|
|
|
|
Future<LockListInfoEntity> deletOwnerKeyData(
|
|
|
|
|
|
{required String lockId, required String keyId}) async {
|
2023-10-19 09:14:34 +08:00
|
|
|
|
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LockListInfoEntity.fromJson(res.body);
|
2023-10-19 09:14:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-17 15:49:09 +08:00
|
|
|
|
// 检查账户密码
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<LockListInfoEntity> checkLoginPassword(
|
|
|
|
|
|
{required String password}) async {
|
2023-10-17 15:49:09 +08:00
|
|
|
|
final res = await apiProvider.checkLoginPassword(password);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LockListInfoEntity.fromJson(res.body);
|
2023-10-17 15:49:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-25 17:06:42 +08:00
|
|
|
|
//获取密码
|
|
|
|
|
|
Future<PasswordKeyEntity> getPasswordKey(
|
2024-01-02 15:32:56 +08:00
|
|
|
|
{required String endDate,
|
|
|
|
|
|
required String isExclusive,
|
|
|
|
|
|
required String keyboardPwdName,
|
|
|
|
|
|
required String keyboardPwdType,
|
|
|
|
|
|
required String keyboardPwdVersion,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String operatorUid,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String timezoneRawOffSet,
|
|
|
|
|
|
required int startHours,
|
|
|
|
|
|
required int endHours,
|
|
|
|
|
|
required int isCoerced}) async {
|
2023-08-25 17:06:42 +08:00
|
|
|
|
final res = await apiProvider.getKeyboardPwd(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
isExclusive,
|
|
|
|
|
|
keyboardPwdName,
|
|
|
|
|
|
keyboardPwdType,
|
|
|
|
|
|
keyboardPwdVersion,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
startDate,
|
2023-10-13 15:01:01 +08:00
|
|
|
|
timezoneRawOffSet,
|
|
|
|
|
|
startHours,
|
2023-11-03 13:58:41 +08:00
|
|
|
|
endHours,
|
|
|
|
|
|
isCoerced);
|
2023-08-25 17:06:42 +08:00
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-28 17:35:30 +08:00
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//自定义密码
|
|
|
|
|
|
Future<PasswordKeyEntity> addPasswordKey(
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String keyboardPwdName,
|
|
|
|
|
|
String keyboardPwd,
|
|
|
|
|
|
String keyboardPwdType,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String addType,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.addKeyboardPwd(lockId, keyboardPwdName,
|
|
|
|
|
|
keyboardPwd, keyboardPwdType, startDate, endDate, addType);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//修改密码
|
|
|
|
|
|
Future<PasswordKeyEntity> updatePasswordKey(
|
2024-01-02 15:32:56 +08:00
|
|
|
|
{required int lockId,
|
|
|
|
|
|
required String keyboardPwdId,
|
|
|
|
|
|
required String keyboardPwdName,
|
|
|
|
|
|
required String newKeyboardPwd,
|
|
|
|
|
|
required int startDate,
|
|
|
|
|
|
required int endDate,
|
|
|
|
|
|
required String changeType,
|
|
|
|
|
|
required String isCoerced,
|
|
|
|
|
|
required int hoursStart,
|
|
|
|
|
|
required int hoursEnd}) async {
|
|
|
|
|
|
final res = await apiProvider.updateKeyboardPwd(
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
keyboardPwdId,
|
|
|
|
|
|
keyboardPwdName,
|
|
|
|
|
|
newKeyboardPwd,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
changeType,
|
|
|
|
|
|
isCoerced,
|
|
|
|
|
|
hoursStart,
|
|
|
|
|
|
hoursEnd);
|
2023-09-07 18:32:56 +08:00
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-28 17:35:30 +08:00
|
|
|
|
//清空操作记录
|
|
|
|
|
|
Future<KeyOperationRecordEntity> clearOperationRecord(String lockId) async {
|
|
|
|
|
|
final res = await apiProvider.clearOperationRecord(lockId);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//创建锁分组
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> addLockGroup(
|
2023-08-28 17:35:30 +08:00
|
|
|
|
String groupName, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.addLockGroup(groupName, operatorUid);
|
2023-09-13 18:13:36 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-08-28 17:35:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// 编辑锁名字
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> editLockGroupRequest(
|
|
|
|
|
|
{required int groupId, required String groupName}) async {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
final res = await apiProvider.editLockGroupRequest(groupId, groupName);
|
|
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//设置锁分组
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> setLockGroup(
|
2023-09-07 18:32:56 +08:00
|
|
|
|
String lockId, String groupId) async {
|
|
|
|
|
|
final res = await apiProvider.setLockGroup(lockId, groupId);
|
2023-09-13 18:13:36 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-09-07 18:32:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-28 17:35:30 +08:00
|
|
|
|
//锁分组列表
|
2023-09-12 18:38:11 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> lockGroupList(String type) async {
|
2023-08-28 17:35:30 +08:00
|
|
|
|
final res = await apiProvider.lockGroupList(type);
|
2023-09-12 18:38:11 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-08-28 17:35:30 +08:00
|
|
|
|
}
|
2023-08-29 17:41:20 +08:00
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
//删除锁分组
|
|
|
|
|
|
Future<MassSendLockGroupListEntity> deleteGroup(int groupId) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.deleteGroup(groupId);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//锁分组里面添加锁
|
|
|
|
|
|
Future<MassSendLockGroupListEntity> lockGroupAddLock(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required List lockIds, required int groupId}) async {
|
|
|
|
|
|
final res = await apiProvider.lockGroupAddLock(lockIds, groupId);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//锁分组里面删除锁
|
|
|
|
|
|
Future<MassSendLockGroupListEntity> lockGroupDeletLock(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required List lockIds}) async {
|
|
|
|
|
|
final res = await apiProvider.lockGroupDeletLock(lockIds);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-25 14:29:57 +08:00
|
|
|
|
//选择锁列表
|
|
|
|
|
|
Future<SelectLockListEntity> selectLockList() async {
|
|
|
|
|
|
final res = await apiProvider.selectLockList();
|
|
|
|
|
|
return SelectLockListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//APP开锁时需手机联网的锁
|
|
|
|
|
|
Future<SelectLockListEntity> setAppUnlockMustOnline(List lockIdList) async {
|
|
|
|
|
|
final res = await apiProvider.setAppUnlockMustOnline(lockIdList);
|
|
|
|
|
|
return SelectLockListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-29 17:41:20 +08:00
|
|
|
|
//删除电子钥匙
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<ElectronicKeyListEntity> deleteElectronicKey(String keyId) async {
|
|
|
|
|
|
final res = await apiProvider.deleteElectronicKey(keyId);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
2023-08-29 17:41:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//删除授权管理员
|
|
|
|
|
|
Future<ElectronicKeyListEntity> deleteAdministrator(
|
|
|
|
|
|
String uid, String includeUnderlings) async {
|
|
|
|
|
|
final res = await apiProvider.deleteAdministrator(uid, includeUnderlings);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新授权管理员
|
2023-09-22 11:45:24 +08:00
|
|
|
|
Future<ElectronicKeyListEntity> updateAdministrator(
|
|
|
|
|
|
String uid,
|
|
|
|
|
|
String keyName,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String remoteEnable) async {
|
2023-09-15 09:43:20 +08:00
|
|
|
|
final res = await apiProvider.updateAdministrator(
|
2023-09-22 11:45:24 +08:00
|
|
|
|
uid, keyName, endDate, startDate, remoteEnable);
|
2023-09-15 09:43:20 +08:00
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//即将到期的锁列表
|
2023-09-19 10:53:41 +08:00
|
|
|
|
Future<ExpireLockListEntity> expireLockList(
|
2023-09-15 09:43:20 +08:00
|
|
|
|
String operatorUid, String pageNo, String pageSize) async {
|
|
|
|
|
|
final res = await apiProvider.expireLockList(operatorUid, pageNo, pageSize);
|
2023-09-19 10:53:41 +08:00
|
|
|
|
return ExpireLockListEntity.fromJson(res.body);
|
2023-09-15 09:43:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-29 17:41:20 +08:00
|
|
|
|
//删除密码
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<PasswordKeyEntity> deleteKeyboardPwd(
|
2023-09-28 18:22:35 +08:00
|
|
|
|
String lockId, String keyboardPwdId, int deleteType) async {
|
2023-08-29 17:41:20 +08:00
|
|
|
|
final res =
|
2023-09-04 11:11:14 +08:00
|
|
|
|
await apiProvider.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
|
2023-08-30 10:58:00 +08:00
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// //分组列表
|
|
|
|
|
|
// Future<PasswordKeyEntity> keyGroupList111(String type) async {
|
|
|
|
|
|
// final res = await apiProvider.keyGroupList(type);
|
|
|
|
|
|
// return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// //分组下的锁
|
|
|
|
|
|
// Future<PasswordKeyEntity> lockListByGroup111(
|
|
|
|
|
|
// String type, String keyGroupId) async {
|
|
|
|
|
|
// final res = await apiProvider.lockListByGroup(type, keyGroupId);
|
|
|
|
|
|
// return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
// }
|
2023-09-07 18:36:16 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取Wifi锁服务器
|
|
|
|
|
|
Future<ConfiguringWifiEntity> getWifiLockServiceIpAndPort() async {
|
|
|
|
|
|
final res = await apiProvider.getWifiLockServiceIpAndPort();
|
|
|
|
|
|
return ConfiguringWifiEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-11 09:48:47 +08:00
|
|
|
|
/// 锁设置模块
|
2023-11-01 17:28:59 +08:00
|
|
|
|
// 自动闭锁
|
|
|
|
|
|
Future<LoginEntity> setAutoUnlock({
|
|
|
|
|
|
required int lockId,
|
2023-11-03 13:58:41 +08:00
|
|
|
|
required int autoLock,
|
|
|
|
|
|
required int autoLockSecond,
|
2023-11-01 17:28:59 +08:00
|
|
|
|
}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.setAutoUnlockLoadData(
|
|
|
|
|
|
lockId, autoLock, autoLockSecond);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 锁声音
|
|
|
|
|
|
Future<LoginEntity> setLockSound({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int lockSound,
|
|
|
|
|
|
required int lockSoundVolume,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
2024-01-23 18:12:51 +08:00
|
|
|
|
await apiProvider.setLockSoundData(lockId, lockSound, lockSoundVolume);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 防撬报警
|
|
|
|
|
|
Future<LoginEntity> setBurglarAlarmData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int antiPrySwitch,
|
|
|
|
|
|
}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.setBurglarAlarmData(lockId, antiPrySwitch);
|
2023-11-01 17:28:59 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 远程开锁开/关
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<LoginEntity> remoteUnlockingOpenOrClose({
|
2023-11-01 17:28:59 +08:00
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int remoteUnlock,
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}) async {
|
2023-09-11 09:48:47 +08:00
|
|
|
|
final res = await apiProvider.remoteUnlockingOpenOrCloseLoadData(
|
2023-11-01 17:28:59 +08:00
|
|
|
|
lockId, remoteUnlock);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-01 17:28:59 +08:00
|
|
|
|
// 重置键
|
|
|
|
|
|
Future<LoginEntity> setResetButtonData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int resetSwitch,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
}) async {
|
2023-11-01 17:28:59 +08:00
|
|
|
|
final res = await apiProvider.setResetButtonData(lockId, resetSwitch);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-03 13:58:41 +08:00
|
|
|
|
// 设置考勤
|
|
|
|
|
|
Future<LoginEntity> setCheckInData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int attendance,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
}) async {
|
2023-11-03 13:58:41 +08:00
|
|
|
|
final res = await apiProvider.setCheckInData(lockId, attendance);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 设置开锁时是否需联网
|
|
|
|
|
|
Future<LoginEntity> setOpenLockNeedOnlineData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int appUnlockOnline,
|
|
|
|
|
|
}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.setOpenLockNeedOnlineData(lockId, appUnlockOnline);
|
2023-11-24 14:23:36 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// 设置开门方向
|
|
|
|
|
|
Future<LoginEntity> setOpenDoorDirectionData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int openDirectionValue,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
2024-01-23 18:12:51 +08:00
|
|
|
|
await apiProvider.setOpenDoorDirectionData(lockId, openDirectionValue);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-03 13:58:41 +08:00
|
|
|
|
// 设置房态
|
|
|
|
|
|
Future<LoginEntity> setRoomStatusData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int roomStatus,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
}) async {
|
2023-11-03 13:58:41 +08:00
|
|
|
|
final res = await apiProvider.setRoomStatusData(lockId, roomStatus);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-03 13:58:41 +08:00
|
|
|
|
// 配置锁的常开模式
|
|
|
|
|
|
Future<LoginEntity> setNormallyModeData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int passageMode,
|
2024-01-11 15:14:02 +08:00
|
|
|
|
required List passageModeConfig,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.setNormallyModeData(
|
|
|
|
|
|
lockId, passageMode, passageModeConfig);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-03 13:58:41 +08:00
|
|
|
|
// 配置锁的常规设置
|
|
|
|
|
|
// Future<LoginEntity> setLockSetGeneralSettingData({
|
|
|
|
|
|
// required String lockId,
|
|
|
|
|
|
// required String changeType,
|
|
|
|
|
|
// required String isOn,
|
|
|
|
|
|
// required String type,
|
|
|
|
|
|
// }) async {
|
|
|
|
|
|
// final res = await apiProvider.setLockSetGeneralSetting(
|
|
|
|
|
|
// lockId, changeType, isOn, type);
|
|
|
|
|
|
// return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 获取锁时间 通过网关
|
2023-11-03 13:58:41 +08:00
|
|
|
|
Future<GetServerDatetimeEntity> getLockTimeFromGateway({
|
2023-09-11 09:48:47 +08:00
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
2023-11-03 13:58:41 +08:00
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-18 11:25:56 +08:00
|
|
|
|
// 设置管理员密码
|
|
|
|
|
|
Future<GetServerDatetimeEntity> setAdminPasswordData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required String adminPwd,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.setAdminPasswordData(lockId, adminPwd);
|
|
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 获取服务器当前时间
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetServerDatetimeEntity> getServerDatetimeData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getServerDatetimeLoadData(lockId);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-09 18:33:37 +08:00
|
|
|
|
// 锁诊断上传数据
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> setLockDiagnoseData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String electricQuantity,
|
|
|
|
|
|
required String firmwareRevision,
|
|
|
|
|
|
required String hardwareRevision,
|
|
|
|
|
|
required String lockDate,
|
|
|
|
|
|
required String modelNum,
|
|
|
|
|
|
required String pwdInfo,
|
|
|
|
|
|
required String timestamp,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.setLockDiagnoseData(
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
electricQuantity,
|
|
|
|
|
|
firmwareRevision,
|
|
|
|
|
|
hardwareRevision,
|
|
|
|
|
|
lockDate,
|
|
|
|
|
|
modelNum,
|
|
|
|
|
|
pwdInfo,
|
|
|
|
|
|
timestamp);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 获取锁版本信息
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetServerDatetimeEntity> getLockVersionInfoData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockVersionInfoLoadData(lockId);
|
|
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-07 18:44:05 +08:00
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//分组下的锁列表
|
|
|
|
|
|
Future<MassSendLockGroupListEntity> listLockByGroup(
|
|
|
|
|
|
String type, String keyGroupId) async {
|
|
|
|
|
|
final res = await apiProvider.listLockByGroup(type, keyGroupId);
|
|
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-04 15:04:44 +08:00
|
|
|
|
//获取单把钥匙详情信息
|
|
|
|
|
|
Future<KeyDetailEntity> getKeyDetail(String lockId) async {
|
|
|
|
|
|
final res = await apiProvider.getKeyDetail(lockId);
|
|
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-07 18:32:56 +08:00
|
|
|
|
|
|
|
|
|
|
//锁用户列表
|
|
|
|
|
|
Future<LockUserListEntity> lockUserList(
|
|
|
|
|
|
String pageNo, String pageSize, String searchStr) async {
|
|
|
|
|
|
final res = await apiProvider.lockUserList(pageNo, pageSize, searchStr);
|
|
|
|
|
|
return LockUserListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-03 13:58:41 +08:00
|
|
|
|
//锁用户列表
|
|
|
|
|
|
Future<LockUserListEntity> deletLockUser(int uid) async {
|
|
|
|
|
|
final res = await apiProvider.deletLockUser(uid);
|
|
|
|
|
|
return LockUserListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//用户拥有的钥匙
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<KeyListByUserEntity> keyListByUser(
|
|
|
|
|
|
String pageNo, String pageSize, String uid) async {
|
|
|
|
|
|
final res = await apiProvider.keyListByUser(pageNo, pageSize, uid);
|
|
|
|
|
|
return KeyListByUserEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//群发电子钥匙检查
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<KeyDetailEntity> canSendKey(String endDate, List lockIdList) async {
|
|
|
|
|
|
final res = await apiProvider.canSendKey(endDate, lockIdList);
|
2023-09-07 18:32:56 +08:00
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
2023-09-09 18:33:37 +08:00
|
|
|
|
|
2023-09-13 18:13:36 +08:00
|
|
|
|
//群发电子钥匙
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<KeyDetailEntity> batchSendKey(
|
|
|
|
|
|
String endDate,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
List keyGroupIdList,
|
|
|
|
|
|
List lockIdList,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
String createUser,
|
|
|
|
|
|
String isRemoteUnlock,
|
|
|
|
|
|
String keyNameForAdmin,
|
|
|
|
|
|
String receiverUsername,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String countryCode,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
String usernameType,
|
|
|
|
|
|
List weekDays) async {
|
2023-09-11 09:48:47 +08:00
|
|
|
|
final res = await apiProvider.batchSendKey(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
keyGroupIdList,
|
|
|
|
|
|
lockIdList,
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyNameForAdmin,
|
|
|
|
|
|
receiverUsername,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
countryCode,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
usernameType,
|
|
|
|
|
|
weekDays);
|
2023-09-11 09:48:47 +08:00
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-11 10:20:44 +08:00
|
|
|
|
|
2023-09-13 18:13:36 +08:00
|
|
|
|
//增加授权管理员
|
|
|
|
|
|
Future<KeyDetailEntity> addAuthorizedAdmin(
|
|
|
|
|
|
String createUser,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String isRemoteUnlock,
|
|
|
|
|
|
List keyGroupIdList,
|
|
|
|
|
|
List lockIdList,
|
|
|
|
|
|
String name,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String userid,
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String usernameType) async {
|
|
|
|
|
|
final res = await apiProvider.addAuthorizedAdmin(
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyGroupIdList,
|
|
|
|
|
|
lockIdList,
|
|
|
|
|
|
name,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
userid,
|
|
|
|
|
|
countryCode,
|
|
|
|
|
|
usernameType);
|
|
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//授权管理员列表
|
|
|
|
|
|
Future<AuthorizedAdminListEntity> authorizedAdminList(
|
|
|
|
|
|
String pageNo, String pageSize) async {
|
|
|
|
|
|
final res = await apiProvider.authorizedAdminList(pageNo, pageSize);
|
|
|
|
|
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-22 11:45:24 +08:00
|
|
|
|
//授权管理员详情
|
|
|
|
|
|
Future<AdministratorDetailEntity> authorizedAdminDetail(int uid) async {
|
|
|
|
|
|
final res = await apiProvider.authorizedAdminDetail(uid);
|
|
|
|
|
|
return AdministratorDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除授权管理员
|
|
|
|
|
|
Future<AuthorizedAdminListEntity> deleteAuthorizedAdmin(
|
|
|
|
|
|
String uid, String includeUnderlings) async {
|
|
|
|
|
|
final res = await apiProvider.deleteAuthorizedAdmin(uid, includeUnderlings);
|
|
|
|
|
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新授权管理员
|
|
|
|
|
|
Future<AuthorizedAdminListEntity> updateAuthorizedAdmin(
|
|
|
|
|
|
String uid,
|
|
|
|
|
|
String name,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String isRemoteUnlock) async {
|
|
|
|
|
|
final res = await apiProvider.updateAuthorizedAdmin(
|
|
|
|
|
|
uid, name, endDate, startDate, isRemoteUnlock);
|
|
|
|
|
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-20 11:49:55 +08:00
|
|
|
|
//提示音
|
|
|
|
|
|
Future<ExpireLockListEntity> setAlertMode(
|
|
|
|
|
|
String alertMode, String isOn) async {
|
|
|
|
|
|
final res = await apiProvider.setAlertMode(alertMode, isOn);
|
|
|
|
|
|
return ExpireLockListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-21 10:05:22 +08:00
|
|
|
|
//触摸开锁
|
|
|
|
|
|
Future<ExpireLockListEntity> setTouchUnlockFlag(String isOn) async {
|
|
|
|
|
|
final res = await apiProvider.setTouchUnlockFlag(isOn);
|
|
|
|
|
|
return ExpireLockListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//触摸开锁
|
|
|
|
|
|
Future<ExpireLockListEntity> changeSettings(String isOn, String type) async {
|
|
|
|
|
|
final res = await apiProvider.changeSettings(isOn, type);
|
|
|
|
|
|
return ExpireLockListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-20 11:49:55 +08:00
|
|
|
|
//个人设置信息
|
2023-09-21 10:05:22 +08:00
|
|
|
|
Future<UserSettingInfoEntity> userSettingsInfo() async {
|
2023-09-20 11:49:55 +08:00
|
|
|
|
final res = await apiProvider.userSettingsInfo();
|
2023-09-21 10:05:22 +08:00
|
|
|
|
return UserSettingInfoEntity.fromJson(res.body);
|
2023-09-20 11:49:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-09 18:33:37 +08:00
|
|
|
|
// 开启考勤 获取考勤信息
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<CheckingInInfoDataEntity> openCheckingInData(
|
|
|
|
|
|
{required String lockId}) async {
|
2023-09-09 18:33:37 +08:00
|
|
|
|
final res = await apiProvider.openCheckingInGetData(lockId);
|
|
|
|
|
|
return CheckingInInfoDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置考勤时创建公司
|
|
|
|
|
|
Future<LoginEntity> setCheckInCreateCompanyData(
|
2023-09-11 10:20:44 +08:00
|
|
|
|
{required String lockId,
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String companyName,
|
|
|
|
|
|
required List workDay,
|
|
|
|
|
|
required String workEndTime,
|
|
|
|
|
|
required String workStartTime}) async {
|
|
|
|
|
|
final res = await apiProvider.setCheckInCreateCompanyData(lockId,
|
|
|
|
|
|
attendanceType, companyName, workDay, workEndTime, workStartTime);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-19 18:15:42 +08:00
|
|
|
|
// 删除公司
|
|
|
|
|
|
Future<CheckingInInfoDataEntity> deletCompanyData(
|
|
|
|
|
|
{required int companyId}) async {
|
|
|
|
|
|
final res = await apiProvider.deletCompanyData(companyId);
|
|
|
|
|
|
return CheckingInInfoDataEntity.fromJson(res.body);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置锁开锁提醒
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> setLockPickingReminderData({
|
2023-11-03 13:58:41 +08:00
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int unlockReminderPush,
|
2023-09-11 10:20:44 +08:00
|
|
|
|
}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.setLockPickingReminderData(
|
|
|
|
|
|
lockId, unlockReminderPush);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:04:11 +08:00
|
|
|
|
// 获取考勤列表 - 早到榜日榜
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInListDayEntity> getCheckInListEarlyArrivalWithDateData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInListEarlyArrivalWithDateData(
|
|
|
|
|
|
companyId, attendanceDate);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInListDayEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 早到榜月榜
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListEarlyArrivalWithMonthData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInListEarlyArrivalWithMonthData(
|
|
|
|
|
|
companyId, attendanceDate);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 迟到榜日榜
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInListDayEntity> getCheckInListLateTimesWithDateData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInListLateTimesWithDateData(
|
|
|
|
|
|
companyId, attendanceDate);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInListDayEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 迟到榜月榜
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListLateTimesWithMonthData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInListLateTimesWithMonthData(
|
|
|
|
|
|
companyId, attendanceDate);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 勤奋榜
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListHardworkingData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInListHardworkingData(
|
|
|
|
|
|
companyId, attendanceDate, type);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤详情
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInDetailEntity> getCheckInDetailData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
required String staffId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInDetailData(
|
|
|
|
|
|
companyId, attendanceDate, staffId);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取员工列表
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInAddStaffListEntity> getStaffListData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getStaffListData(companyId, lockId);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInAddStaffListEntity.fromJson(res.body);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加员工
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> addStaffData({
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String attendanceWay,
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String have,
|
|
|
|
|
|
required String staffName,
|
|
|
|
|
|
required String countryCode,
|
|
|
|
|
|
required String usernameType,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addStaffData(attendanceType, attendanceWay,
|
|
|
|
|
|
companyId, have, staffName, countryCode, usernameType);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:04:11 +08:00
|
|
|
|
// 编辑员工
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<LoginEntity> editStaffData({
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String attendanceWay,
|
|
|
|
|
|
required String staffId,
|
|
|
|
|
|
required String have,
|
|
|
|
|
|
required String staffName,
|
|
|
|
|
|
required String countryCode,
|
|
|
|
|
|
required String usernameType,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.editStaffData(attendanceType, attendanceWay,
|
|
|
|
|
|
staffId, have, staffName, countryCode, usernameType);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加员工选择钥匙
|
2024-01-23 17:29:18 +08:00
|
|
|
|
Future<CheckingInAddStaffSelectKeyEntity> addStaffSelectKeyData({
|
2023-09-20 11:49:55 +08:00
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
2024-01-23 17:29:18 +08:00
|
|
|
|
final res = await apiProvider.addStaffSelectKeyData(companyId, type);
|
|
|
|
|
|
return CheckingInAddStaffSelectKeyEntity.fromJson(res.body);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加假期
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<LoginEntity> addHolidaysData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String fillClassDate,
|
|
|
|
|
|
required String vacationEndDate,
|
|
|
|
|
|
required String vacationName,
|
|
|
|
|
|
required String vacationStartDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addHolidaysData(companyId, fillClassDate,
|
|
|
|
|
|
vacationEndDate, vacationName, vacationStartDate);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 假期列表
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInSetHolidaysInfoDataEntity> holidaysListData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String vacationYear,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.holidaysListData(companyId, vacationYear);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInSetHolidaysInfoDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除假期
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<LoginEntity> deletHolidaysData({required String vacationId}) async {
|
|
|
|
|
|
final res = await apiProvider.deletHolidaysData(vacationId);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤设置信息
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInSetEntity> getCheckInSetInfoData({
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getCheckInSetInfoData(companyId);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInSetEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 修改考勤设置信息
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<CheckingInSetEntity> editCheckInSetInfoData({
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String companyName,
|
|
|
|
|
|
required String workEndTime,
|
|
|
|
|
|
required String workStartTime,
|
|
|
|
|
|
required List<int> workDay,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.editCheckInSetInfoData(attendanceType,
|
|
|
|
|
|
companyId, type, companyName, workEndTime, workStartTime, workDay);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInSetEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取指纹列表
|
2023-09-20 11:49:55 +08:00
|
|
|
|
Future<FingerprintListDataEntity> getFingerprintsListData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String pageNo,
|
|
|
|
|
|
required String pageSize,
|
|
|
|
|
|
required String searchStr,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getFingerprintsListData(
|
|
|
|
|
|
lockId, pageNo, pageSize, searchStr);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return FingerprintListDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加指纹
|
2023-09-23 18:35:06 +08:00
|
|
|
|
Future<AddFingerprintEntity> addFingerprintsData({
|
2023-09-20 11:49:55 +08:00
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String addType,
|
|
|
|
|
|
required String fingerprintName,
|
|
|
|
|
|
required String fingerprintNumber,
|
|
|
|
|
|
required String fingerprintType,
|
|
|
|
|
|
required String isCoerced,
|
|
|
|
|
|
required String startDate,
|
2023-09-20 13:34:16 +08:00
|
|
|
|
required List weekDay,
|
2023-09-20 11:49:55 +08:00
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addFingerprintsData(
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
addType,
|
|
|
|
|
|
fingerprintName,
|
|
|
|
|
|
fingerprintNumber,
|
|
|
|
|
|
fingerprintType,
|
|
|
|
|
|
isCoerced,
|
|
|
|
|
|
startDate,
|
2023-09-20 13:34:16 +08:00
|
|
|
|
weekDay);
|
2023-09-23 18:35:06 +08:00
|
|
|
|
return AddFingerprintEntity.fromJson(res.body);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
}
|
2023-09-19 15:20:58 +08:00
|
|
|
|
|
|
|
|
|
|
// 编辑指纹
|
|
|
|
|
|
Future<LoginEntity> editFingerprintsData(
|
2023-09-20 13:34:16 +08:00
|
|
|
|
{required String fingerprintId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required List weekDay,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String isCoerced,
|
2023-12-13 17:38:50 +08:00
|
|
|
|
required String fingerprintName,
|
|
|
|
|
|
required String changeType}) async {
|
2023-09-20 13:34:16 +08:00
|
|
|
|
final res = await apiProvider.editFingerprintsData(fingerprintId, lockId,
|
2023-12-13 17:38:50 +08:00
|
|
|
|
weekDay, startDate, endDate, isCoerced, fingerprintName, changeType);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除指纹
|
|
|
|
|
|
Future<LoginEntity> deletFingerprintsData(
|
2023-09-20 13:34:16 +08:00
|
|
|
|
{required String fingerprintId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String deleteType}) async {
|
|
|
|
|
|
final res = await apiProvider.deletFingerprintsData(
|
|
|
|
|
|
fingerprintId, lockId, type, deleteType);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新指纹用户序号
|
|
|
|
|
|
Future<LoginEntity> updateFingerprintUserNoLoadData(
|
2023-09-20 13:34:16 +08:00
|
|
|
|
{required String fingerprintId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String fingerprintUserNo}) async {
|
|
|
|
|
|
final res = await apiProvider.updateFingerprintUserNoLoadData(
|
|
|
|
|
|
fingerprintId, lockId, fingerprintUserNo);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-12 19:05:44 +08:00
|
|
|
|
// 校验指纹名字是否重复
|
|
|
|
|
|
Future<LoginEntity> checkFingerprintNameDuplicatedData(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String lockId, required String fingerprintName}) async {
|
2024-01-12 19:05:44 +08:00
|
|
|
|
final res = await apiProvider.checkFingerprintNameDuplicatedData(
|
|
|
|
|
|
lockId, fingerprintName);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-23 18:12:51 +08:00
|
|
|
|
// 获取人脸列表
|
2024-01-24 18:51:18 +08:00
|
|
|
|
Future<FingerprintListDataEntity> getFaceListData({
|
2024-01-23 18:12:51 +08:00
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String pageNo,
|
|
|
|
|
|
required String pageSize,
|
|
|
|
|
|
required String searchStr,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getFaceListData(lockId, pageNo, pageSize, searchStr);
|
2024-01-24 18:51:18 +08:00
|
|
|
|
return FingerprintListDataEntity.fromJson(res.body);
|
2024-01-23 18:12:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加人脸
|
2024-01-24 18:51:18 +08:00
|
|
|
|
Future<AddFaceEntity> addFaceData({
|
2024-01-23 18:12:51 +08:00
|
|
|
|
required int lockId,
|
|
|
|
|
|
required String faceName,
|
|
|
|
|
|
required String faceNumber,
|
|
|
|
|
|
required int faceType,
|
|
|
|
|
|
required int startDate,
|
|
|
|
|
|
required int endDate,
|
|
|
|
|
|
required String featureData,
|
|
|
|
|
|
required String addType,
|
|
|
|
|
|
required List cyclicConfig,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addFaceData(lockId, faceName, faceNumber,
|
|
|
|
|
|
faceType, startDate, endDate, featureData, addType, cyclicConfig);
|
2024-01-24 18:51:18 +08:00
|
|
|
|
return AddFaceEntity.fromJson(res.body);
|
2024-01-23 18:12:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 校验人脸名字是否重复
|
|
|
|
|
|
Future<LoginEntity> checkFaceNameDuplicatedData(
|
|
|
|
|
|
{required String lockId, required String faceName}) async {
|
|
|
|
|
|
final res = await apiProvider.checkFaceNameDuplicatedData(lockId, faceName);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新人脸用户序号
|
2024-01-24 18:51:18 +08:00
|
|
|
|
Future<LoginEntity> updateFaceUserNo(
|
|
|
|
|
|
{required int faceId,
|
|
|
|
|
|
required int lockId,
|
2024-01-23 18:12:51 +08:00
|
|
|
|
required String faceUserNo}) async {
|
2024-01-24 18:51:18 +08:00
|
|
|
|
final res = await apiProvider.updateFaceUserNo(faceId, lockId, faceUserNo);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新人脸用户信息--人脸名称
|
|
|
|
|
|
Future<LoginEntity> updateFaceName(
|
|
|
|
|
|
{required int faceId,
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required String faceName}) async {
|
|
|
|
|
|
final res = await apiProvider.updateFaceName(faceId, lockId, faceName);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新人脸用户信息--有效期
|
|
|
|
|
|
Future<LoginEntity> updateFaceValidity(
|
|
|
|
|
|
{required int faceId,
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
required int startDate,
|
|
|
|
|
|
required int endDate}) async {
|
|
|
|
|
|
final res = await apiProvider.updateFaceValidity(
|
|
|
|
|
|
faceId, lockId, startDate, endDate);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除人脸
|
|
|
|
|
|
Future<LoginEntity> deleteFaceData({
|
|
|
|
|
|
required int faceId,
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.deleteFaceData(faceId, lockId);
|
2024-01-23 18:12:51 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-24 18:51:18 +08:00
|
|
|
|
// 清空人脸
|
|
|
|
|
|
Future<LoginEntity> clearFaceData({
|
|
|
|
|
|
required int lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.clearFaceData(lockId);
|
2024-01-23 18:12:51 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-25 15:43:10 +08:00
|
|
|
|
// 获取商城跳转地址
|
|
|
|
|
|
Future<LockMallDataEntity> getMallURLData() async {
|
|
|
|
|
|
final res = await apiProvider.getMallURLData();
|
|
|
|
|
|
return LockMallDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-19 15:20:58 +08:00
|
|
|
|
// 获取Ic卡列表
|
2023-09-20 13:34:16 +08:00
|
|
|
|
Future<FingerprintListDataEntity> getICCardListData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String pageNo,
|
|
|
|
|
|
required String pageSize,
|
|
|
|
|
|
required String searchStr,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getICCardListData(
|
|
|
|
|
|
lockId, pageNo, pageSize, searchStr);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return FingerprintListDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加ID卡
|
2023-09-23 18:35:06 +08:00
|
|
|
|
Future<AddICCardEntity> addICCardData({
|
2023-09-20 13:34:16 +08:00
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String cardName,
|
|
|
|
|
|
required String cardNumber,
|
|
|
|
|
|
required String cardType,
|
|
|
|
|
|
required String addType,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String isCoerced,
|
|
|
|
|
|
required List weekDay,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addICCardData(lockId, endDate, cardName,
|
|
|
|
|
|
cardNumber, cardType, addType, startDate, isCoerced, weekDay);
|
2023-09-23 18:35:06 +08:00
|
|
|
|
return AddICCardEntity.fromJson(res.body);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑IC卡
|
|
|
|
|
|
Future<LoginEntity> editICCardData(
|
2023-09-20 13:34:16 +08:00
|
|
|
|
{required String lockId,
|
|
|
|
|
|
required String cardId,
|
|
|
|
|
|
required String cardName,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String isCoerced,
|
2023-12-16 11:20:36 +08:00
|
|
|
|
required List weekDay,
|
|
|
|
|
|
required String changeType}) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
final res = await apiProvider.editICCardData(lockId, cardId, cardName,
|
|
|
|
|
|
startDate, endDate, isCoerced, weekDay, changeType);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除ic卡
|
|
|
|
|
|
Future<LoginEntity> deletIcCardData(
|
2023-09-20 13:34:16 +08:00
|
|
|
|
{required String cardId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String deleteType}) async {
|
2023-09-19 15:20:58 +08:00
|
|
|
|
final res =
|
2023-09-20 13:34:16 +08:00
|
|
|
|
await apiProvider.deletIcCardData(cardId, lockId, type, deleteType);
|
2023-09-19 15:20:58 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-20 14:22:44 +08:00
|
|
|
|
|
|
|
|
|
|
// 更新ICCard用户序号
|
|
|
|
|
|
Future<LoginEntity> updateIdCardUserNoLoadData(
|
2023-09-22 11:45:24 +08:00
|
|
|
|
{required String lockId,
|
|
|
|
|
|
required String cardId,
|
|
|
|
|
|
required String cardUserNo}) async {
|
|
|
|
|
|
final res = await apiProvider.updateIdCardUserNoLoadData(
|
|
|
|
|
|
lockId, cardId, cardUserNo);
|
2023-09-20 14:22:44 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-25 14:29:57 +08:00
|
|
|
|
|
2024-01-12 19:05:44 +08:00
|
|
|
|
// 校验卡名字是否重复
|
|
|
|
|
|
Future<LoginEntity> checkCardNameDuplicatedData(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String lockId, required String cardName}) async {
|
|
|
|
|
|
final res = await apiProvider.checkCardNameDuplicatedData(lockId, cardName);
|
2024-01-12 19:05:44 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-25 14:29:57 +08:00
|
|
|
|
// 退出登录
|
|
|
|
|
|
Future<LoginEntity> userLogout() async {
|
|
|
|
|
|
final res = await apiProvider.userLogout();
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-25 15:23:23 +08:00
|
|
|
|
|
2023-09-22 16:06:08 +08:00
|
|
|
|
// 获取转移锁锁列表
|
|
|
|
|
|
Future<TransferSmartLockEntity> getTransferLockListData() async {
|
|
|
|
|
|
final res = await apiProvider.getTransferLockListData();
|
|
|
|
|
|
return TransferSmartLockEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 转移智能锁确认
|
2023-09-23 18:35:06 +08:00
|
|
|
|
Future<RecipientInformationEntity> transferLockConfirmInfoData(
|
|
|
|
|
|
{required String receiverUserid,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String countryCode}) async {
|
|
|
|
|
|
final res = await apiProvider.transferLockConfirmInfoData(
|
|
|
|
|
|
receiverUserid, type, countryCode);
|
2023-09-22 16:06:08 +08:00
|
|
|
|
return RecipientInformationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 转移智能锁
|
2023-09-23 18:35:06 +08:00
|
|
|
|
Future<RecipientInformationEntity> transferLockInfoData(
|
|
|
|
|
|
{required String receiverUserid,
|
|
|
|
|
|
required List lockIdList,
|
|
|
|
|
|
required String countryCode}) async {
|
|
|
|
|
|
final res = await apiProvider.transferLockInfoData(
|
|
|
|
|
|
receiverUserid, lockIdList, countryCode);
|
2023-09-22 16:06:08 +08:00
|
|
|
|
return RecipientInformationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取网关列表
|
2023-09-23 18:35:06 +08:00
|
|
|
|
Future<GetewayDataEntity> getGatewayListData(
|
|
|
|
|
|
{required String pageNo, required String pageSize}) async {
|
2023-09-22 16:06:08 +08:00
|
|
|
|
final res = await apiProvider.getGatewayListData(pageNo, pageSize);
|
|
|
|
|
|
return GetewayDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-23 18:35:06 +08:00
|
|
|
|
// 转移网关确认
|
|
|
|
|
|
Future<RecipientInformationEntity> transferGatewayConfirmInfoData(
|
|
|
|
|
|
{required String receiverUserid,
|
2023-09-25 15:23:23 +08:00
|
|
|
|
required String type,
|
|
|
|
|
|
required String countryCode}) async {
|
2023-09-23 18:35:06 +08:00
|
|
|
|
final res = await apiProvider.transferGatewayConfirmInfoData(
|
|
|
|
|
|
receiverUserid, type, countryCode);
|
|
|
|
|
|
return RecipientInformationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 转移智能锁
|
|
|
|
|
|
Future<RecipientInformationEntity> transferGatewayInfoData(
|
|
|
|
|
|
{required String receiverUserid,
|
2023-09-25 15:23:23 +08:00
|
|
|
|
required List plugIdList,
|
|
|
|
|
|
required String countryCode}) async {
|
2023-09-23 18:35:06 +08:00
|
|
|
|
final res = await apiProvider.transferGatewayInfoData(
|
|
|
|
|
|
receiverUserid, plugIdList, countryCode);
|
|
|
|
|
|
return RecipientInformationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-28 18:22:35 +08:00
|
|
|
|
|
|
|
|
|
|
//删除账号
|
2023-10-09 18:45:10 +08:00
|
|
|
|
Future<LoginEntity> deleteAccount(
|
2023-10-13 15:53:20 +08:00
|
|
|
|
String channel, String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.deleteAccount(channel, verificationCode);
|
2023-10-09 18:45:10 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
2023-09-28 18:22:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取个人信息
|
2023-10-09 18:45:10 +08:00
|
|
|
|
Future<MinePersonInfoEntity> getUserInfo(String operatorUid) async {
|
2023-09-28 18:22:35 +08:00
|
|
|
|
final res = await apiProvider.getUserInfo(operatorUid);
|
2023-10-09 18:45:10 +08:00
|
|
|
|
return MinePersonInfoEntity.fromJson(res.body);
|
2023-09-28 18:22:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//重置密码钥匙
|
|
|
|
|
|
Future<PasswordKeyListEntity> keyboardPwdReset(String lockId) async {
|
|
|
|
|
|
final res = await apiProvider.keyboardPwdReset(lockId);
|
|
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-10-09 18:45:10 +08:00
|
|
|
|
|
|
|
|
|
|
// 发送验证码 2、登陆后可使用 sendValidationCodeAuth 接口,免图片滑动验证 5删除账号
|
|
|
|
|
|
Future<SendValidationCodeEntity> getValidationCodeAuth(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String account,
|
|
|
|
|
|
String channel,
|
|
|
|
|
|
String codeType,
|
|
|
|
|
|
String uniqueid,
|
|
|
|
|
|
String xWidth) async {
|
|
|
|
|
|
final res = await apiProvider.getValidationCodeAuth(
|
|
|
|
|
|
countryCode, account, channel, codeType, uniqueid, xWidth);
|
|
|
|
|
|
return SendValidationCodeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新个人信息-头像/昵称
|
|
|
|
|
|
Future<PasswordKeyListEntity> updateUserInfo(String nickname) async {
|
|
|
|
|
|
final res = await apiProvider.updateUserInfo(nickname);
|
|
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-11 18:24:52 +08:00
|
|
|
|
//修改绑定手机号
|
|
|
|
|
|
Future<PasswordKeyListEntity> bindPhone(String countryCode, String account,
|
|
|
|
|
|
String verificationCode, String unbindToken) async {
|
|
|
|
|
|
final res = await apiProvider.bindPhone(
|
|
|
|
|
|
countryCode, account, verificationCode, unbindToken);
|
2023-10-09 18:45:10 +08:00
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-11 18:24:52 +08:00
|
|
|
|
//修改绑定邮箱
|
|
|
|
|
|
Future<PasswordKeyListEntity> bindEmail(
|
|
|
|
|
|
String email, String verificationCode, String unbindToken) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.bindEmail(email, verificationCode, unbindToken);
|
2023-10-09 18:45:10 +08:00
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//重置密码
|
|
|
|
|
|
Future<LoginEntity> changePassword(String date, String newPassword,
|
|
|
|
|
|
String oldPassword, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.changePassword(
|
|
|
|
|
|
date, newPassword, oldPassword, operatorUid);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-10-11 18:24:52 +08:00
|
|
|
|
|
|
|
|
|
|
//获取安全信息列表
|
|
|
|
|
|
Future<MineSetSafetyProblemEntity> getQuestionList(
|
|
|
|
|
|
String operatorUid, String countryCode) async {
|
|
|
|
|
|
final res = await apiProvider.getQuestionList(operatorUid, countryCode);
|
|
|
|
|
|
return MineSetSafetyProblemEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取已设置的安全信息
|
|
|
|
|
|
Future<MineViewSafetyProblemEntity> getOwnQuestionList() async {
|
|
|
|
|
|
final res = await apiProvider.getOwnQuestionList();
|
|
|
|
|
|
return MineViewSafetyProblemEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置安全信息
|
|
|
|
|
|
Future<LoginEntity> setSafeAnswer(List questionAndAnswerList) async {
|
|
|
|
|
|
final res = await apiProvider.setSafeAnswer(questionAndAnswerList);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上传头像 先获取upToken 再调用updateUserInfo
|
2023-11-24 14:23:36 +08:00
|
|
|
|
Future<MinePersonGetUploadFileInfoEntity> getUpToken(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
{required String module,
|
|
|
|
|
|
required String typeKey,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String filename,
|
|
|
|
|
|
required int size}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getUpToken(module, typeKey, type, filename, size);
|
2023-11-24 14:23:36 +08:00
|
|
|
|
return MinePersonGetUploadFileInfoEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 文件上传
|
2024-01-23 18:12:51 +08:00
|
|
|
|
Future<LoginEntity> uploadFile({
|
|
|
|
|
|
required String url,
|
|
|
|
|
|
required dynamic body,
|
|
|
|
|
|
}) async {
|
2023-11-24 14:23:36 +08:00
|
|
|
|
final res = await apiProvider.uploadFile(url, body);
|
2023-10-11 18:24:52 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取解绑手机号Token
|
|
|
|
|
|
Future<MineUnbindPhoneOrEmailEntity> unbindPhoneToken(
|
|
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.unbindPhoneToken(verificationCode);
|
|
|
|
|
|
return MineUnbindPhoneOrEmailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取解绑邮箱Token
|
|
|
|
|
|
Future<MineUnbindPhoneOrEmailEntity> unbindEmailToken(
|
|
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.unbindEmailToken(verificationCode);
|
|
|
|
|
|
return MineUnbindPhoneOrEmailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-11-16 10:04:38 +08:00
|
|
|
|
|
|
|
|
|
|
//推送绑定DeviceID
|
|
|
|
|
|
Future<MineUnbindPhoneOrEmailEntity> pushBindAppId(
|
|
|
|
|
|
String deviceId, int deviceType) async {
|
|
|
|
|
|
final res = await apiProvider.pushBindAppId(deviceId, deviceType);
|
|
|
|
|
|
return MineUnbindPhoneOrEmailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2024-01-24 18:44:34 +08:00
|
|
|
|
|
|
|
|
|
|
// 消息列表
|
2024-01-25 15:43:10 +08:00
|
|
|
|
Future<MessageListEntity> messageListLoadData(
|
|
|
|
|
|
{required String pageNo, required String pageSize}) async {
|
2024-01-24 18:44:34 +08:00
|
|
|
|
final res = await apiProvider.messageListLoadData(pageNo, pageSize);
|
|
|
|
|
|
return MessageListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 读取消息
|
|
|
|
|
|
Future<MessageListEntity> readMessageLoadData({
|
|
|
|
|
|
required String messageId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.readMessageLoadData(messageId);
|
|
|
|
|
|
return MessageListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-25 17:40:41 +08:00
|
|
|
|
// 删除消息
|
|
|
|
|
|
Future<MessageListEntity> deletMessageLoadData({
|
|
|
|
|
|
required String messageId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.deletMessageLoadData(messageId);
|
|
|
|
|
|
return MessageListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-07-27 15:29:37 +08:00
|
|
|
|
}
|