diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart index f1432dcf..a3eb457f 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:get/get.dart'; @@ -138,35 +137,49 @@ class CheckingInAddStaffLogic extends BaseGetXController{ have: state.appUnHaveAccount.value ? "2" : "1", staffName: state.staffNameController.text, countryCode: state.countryCode.value, - usernameType:usernameType, + usernameType: usernameType, ); - if(entity.errorCode!.codeIsSuccessful){ + if (entity.errorCode!.codeIsSuccessful) { eventBus.fire(RefreshCheckInStaffListDataEvent()); Get.close(2); - }else if(entity.errorCode! == 425){ + } else if (entity.errorCode! == 425) { Toast.show(msg: entity.errorMsg!); } } //获取密码请求 void getKeyboardPwdRequest() async { - if(state.staffNameController.text.isEmpty){ + if (state.staffNameController.text.isEmpty) { Toast.show(msg: "请输入姓名"); return; } + // var entity = await ApiRepository.to.getPasswordKey( + // "0", + // '0', + // state.staffNameController.text, + // 2.toString(), + // '0', + // state.getKeyInfosData.value.lockId.toString(), + // '0', + // "0", + // '0', + // 0, + // 0, + // 1); var entity = await ApiRepository.to.getPasswordKey( - "0", - '0', - state.staffNameController.text, - 2.toString(), - '0', - state.getKeyInfosData.value.lockId.toString(), - '0', - "0", - '0', - 0, - 0, - 1); + endDate: "0", + isExclusive: '0', + keyboardPwdName: state.staffNameController.text, + keyboardPwdType: 2.toString(), + keyboardPwdVersion: '0', + lockId: state.getKeyInfosData.value.lockId.toString(), + operatorUid: '0', + startDate: '0', + timezoneRawOffSet: '0', + startHours: 0, + endHours: 0, + isCoerced: 1); + if (entity.errorCode!.codeIsSuccessful) { print('获取密码成功'); if (entity.data != null) { diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart new file mode 100644 index 00000000..0ef8c6dc --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart @@ -0,0 +1,48 @@ +import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart'; +import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart'; +import 'package:star_lock/network/api_repository.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/tools/toast.dart'; + +class ElectronicKeyDetailChangeDateLogic extends BaseGetXController { + final ElectronicKeyDetailChangeDateState state = + ElectronicKeyDetailChangeDateState(); + + //更新密码请求 + Future updatePwdRequest() async { + PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey( + lockId: state.itemData.value.lockId!, + keyboardPwdId: state.pwdId.value.toString(), + keyboardPwdName: state.inputNameController.text, + newKeyboardPwd: state.inputPwdController.text, + startDate: state.startDate.value, + endDate: state.endDate.value, + changeType: state.changeType.value, + hoursStart: state.hoursStart.value, + hoursEnd: state.hoursEnd.value, + isCoerced: state.isCoerced.value); + if (entity.errorCode!.codeIsSuccessful) { + Toast.show(msg: "修改成功"); + Get.back(); + } + } + + //修改钥匙名称请求 + Future updateKeyDateRequest() async { + KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( + state.itemData.value.keyId.toString(), + state.itemData.value.lockId.toString(), + state.failureDateTime.millisecondsSinceEpoch.toString(), + state.endDay.value, + '', + state.effectiveDateTime.millisecondsSinceEpoch.toString(), + state.startDay.value, + state.weekDays.value); + if (entity.errorCode!.codeIsSuccessful) { + Toast.show(msg: "修改成功"); + Get.back(); + } + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart index 125126cf..52239b04 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart @@ -1,16 +1,9 @@ import 'package:flutter/material.dart'; -// import 'package:flutter_pickers/pickers.dart'; -// import 'package:flutter_pickers/time_picker/model/date_mode.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; -import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart'; -import 'package:star_lock/network/api_repository.dart'; -import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart'; import 'package:star_lock/tools/pickers/pickers.dart'; import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart'; -import 'package:star_lock/tools/toast.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/commonItem.dart'; @@ -27,34 +20,11 @@ class ElectronicKeyDetailChangeDate extends StatefulWidget { class _ElectronicKeyDetailChangeDateState extends State { - ElectronicKeyListItem itemData = ElectronicKeyListItem(); - - String _selectEffectiveDate = ''; //生效时间 - String _selectFailureDate = ''; //失效时间 - late DateTime _effectiveDateTime; - late DateTime _failureDateTime; - late String endDay = ''; - late String startDay = ''; - late List weekDays = []; - late String pwdId = ''; - late String lockId = ''; - late String fromType = ''; // 1 从指纹详情进入 + final logic = Get.put(ElectronicKeyDetailChangeDateLogic()); + final state = Get.find().state; @override Widget build(BuildContext context) { - dynamic obj = ModalRoute.of(context)?.settings.arguments; - if (obj != null && (obj["itemData"] != null)) { - itemData = obj["itemData"]; - } - if (obj != null && (obj["pwdId"] != null)) { - pwdId = obj["pwdId"]; - } - if (obj != null && (obj["lockId"] != null)) { - lockId = obj["lockId"]; - } - if (obj != null && (obj["fromType"] != null)) { - fromType = obj["fromType"]; - } return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( @@ -69,12 +39,12 @@ class _ElectronicKeyDetailChangeDateState style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () { - if (fromType == "1") { + if (state.fromType.value == "1") { } else { - if (lockId.isNotEmpty && pwdId.isNotEmpty) { - updatePwdRequest(); + if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) { + logic.updatePwdRequest(); } else { - updateKeyDateRequest(); + logic.updateKeyDateRequest(); } } }, @@ -88,77 +58,37 @@ class _ElectronicKeyDetailChangeDateState Widget buildMainUI() { return Column( children: [ - CommonItem( + Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, - rightTitle: _selectEffectiveDate, + rightTitle: state.selectEffectiveDate.value, isHaveLine: true, isHaveDirection: true, action: () { Pickers.showDatePicker(context, mode: DateMode.YMDHM, onConfirm: (p) { - setState(() { - _selectEffectiveDate = - '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; - _effectiveDateTime = DateTime.parse(_selectEffectiveDate); - }); + state.selectEffectiveDate.value = + '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; + state.effectiveDateTime = + DateTime.parse(state.selectEffectiveDate.value); }); - }), - CommonItem( + })), + Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, - rightTitle: _selectFailureDate, + rightTitle: state.selectFailureDate.value, isHaveDirection: true, action: () { Pickers.showDatePicker(context, mode: DateMode.YMDHM, onConfirm: (p) { - setState(() { - _selectFailureDate = - '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; - _failureDateTime = DateTime.parse(_selectFailureDate); - }); + state.selectFailureDate.value = + '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; + state.failureDateTime = + DateTime.parse(state.selectFailureDate.value); }); - }), + })), ], ); } - //修改钥匙名称请求 - Future updateKeyDateRequest() async { - KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate( - itemData.keyId.toString(), - itemData.lockId.toString(), - _failureDateTime.millisecondsSinceEpoch.toString(), - endDay, - '', - _effectiveDateTime.millisecondsSinceEpoch.toString(), - startDay, - weekDays); - if (entity.errorCode!.codeIsSuccessful) { - print("修改要是名称成功啦啦啦啦啦"); - Toast.show(msg: "修改成功"); - setState(() { - Navigator.pop(context); - }); - } - } - - //更新密码请求 - Future updatePwdRequest() async { - PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey( - lockId, - pwdId, - '', - '', - _effectiveDateTime.millisecondsSinceEpoch.toString(), - _failureDateTime.millisecondsSinceEpoch.toString(), - ''); - if (entity.errorCode!.codeIsSuccessful) { - Toast.show(msg: "修改成功"); - setState(() { - Navigator.pop(context); - }); - } - } - String intToStr(int v) { return (v < 10) ? "0$v" : "$v"; } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart new file mode 100644 index 00000000..cac37195 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; + +class ElectronicKeyDetailChangeDateState { + final itemData = ElectronicKeyListItem().obs; + final TextEditingController inputPwdController = TextEditingController(); + final TextEditingController inputNameController = TextEditingController(); + final changeType = '1' + .obs; //1-通过APP走蓝牙修改,不传默认1,必需先通过APP SDK蓝牙修改后调用该接口 2-通过网关或WiFi锁修改,如果是WiFi锁或有连接网关,则可以传2,直接调用该接口修改生效 + final isCoerced = '1'.obs; //胁迫指纹:1;非胁迫指纹:2(胁迫指纹开锁触发报警) + final hoursStart = 0.obs; + final hoursEnd = 0.obs; + final startDate = 0.obs; + final endDate = 0.obs; + final pwdId = ''.obs; + final lockId = 0.obs; + final fromType = ''.obs; + final selectEffectiveDate = ''.obs; //生效时间 + final selectFailureDate = ''.obs; //失效时间 + DateTime effectiveDateTime = DateTime.now(); + DateTime failureDateTime = DateTime.now(); + final endDay = ''.obs; + final startDay = ''.obs; + final weekDays = [].obs; + + ElectronicKeyDetailChangeDateState() { + Map map = Get.arguments; + // itemData.value = map["itemData"]; + if ((map["itemData"] != null)) { + itemData.value = map["itemData"]; + } + if ((map["pwdId"] != null)) { + pwdId.value = map["pwdId"]; + } + if ((map["lockId"] != null)) { + lockId.value = map["lockId"]; + } + if ((map["fromType"] != null)) { + fromType.value = map["fromType"]; + } + } +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart index 04a6c0d3..9bb42161 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart @@ -23,13 +23,16 @@ class PasswordKeyDetailLogic extends BaseGetXController { //更新密码请求 Future updatePwdRequest() async { PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey( - state.itemData.value.lockId.toString(), - state.itemData.value.keyboardPwdId.toString(), - state.inputNameController.text, - state.inputPwdController.text, - '', - '', - ''); + lockId: state.itemData.value.lockId!, + keyboardPwdId: state.itemData.value.keyboardPwdId.toString(), + keyboardPwdName: state.inputNameController.text, + newKeyboardPwd: state.inputPwdController.text, + startDate: state.startDate.value, + endDate: state.endDate.value, + changeType: state.changeType.value, + hoursStart: state.hoursStart.value, + hoursEnd: state.hoursEnd.value, + isCoerced: state.isCoerced.value); if (entity.errorCode!.codeIsSuccessful) { Toast.show(msg: "修改成功"); Get.back(); diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index a175268a..1b89d35d 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -55,10 +55,19 @@ class _PasswordKeyDetailPageState extends State { rightTitle: state.inputPwdController.text.isNotEmpty ? state.inputPwdController.text : state.itemData.value.keyboardPwd, - isHaveDirection: true, + isHaveDirection: (state.itemData.value.keyboardPwdType == 1 || + state.itemData.value.keyboardPwdType == 4) + ? false + : true, isHaveLine: true, action: () { - showCupertinoAlertDialog(context, state.inputPwdController); + if (state.itemData.value.keyboardPwdType == 1 || + state.itemData.value.keyboardPwdType == 4) { + return; + } else { + showCupertinoAlertDialog( + context, state.inputPwdController); + } }), CommonItem( leftTitel: TranslationLoader.lanKeys!.name!.tr, diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.dart index b838e3c0..5745bef6 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.dart @@ -6,6 +6,13 @@ class PasswordKeyDetailState { final itemData = PasswordKeyListItem().obs; final TextEditingController inputPwdController = TextEditingController(); final TextEditingController inputNameController = TextEditingController(); + final changeType = '1' + .obs; //1-通过APP走蓝牙修改,不传默认1,必需先通过APP SDK蓝牙修改后调用该接口 2-通过网关或WiFi锁修改,如果是WiFi锁或有连接网关,则可以传2,直接调用该接口修改生效 + final isCoerced = '1'.obs; //胁迫指纹:1;非胁迫指纹:2(胁迫指纹开锁触发报警) + final hoursStart = 0.obs; + final hoursEnd = 0.obs; + final startDate = 0.obs; + final endDate = 0.obs; PasswordKeyDetailState() { Map map = Get.arguments; diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart index 4b920eb8..82b30cde 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_logic.dart @@ -12,9 +12,8 @@ class PasswordKeyListLogic extends BaseGetXController { //请求密码钥匙列表 void mockNetworkDataRequest() async { PasswordKeyListEntity entity = await ApiRepository.to.passwordKeyList( - '0', + state.keyInfo.value.keyStatus.toString(), state.keyInfo.value.lockId.toString(), - '0', state.pageNum.toString(), state.pageSize.toString(), state.searchController.text); @@ -35,9 +34,10 @@ class PasswordKeyListLogic extends BaseGetXController { } //删除密码请求 deleteType:1-蓝牙 2-网关 - Future deletePwdRequest(String lockId, String keyboardPwdId, int deleteType) async { - PasswordKeyEntity entity = await ApiRepository.to.deleteKeyboardPwd( - lockId, keyboardPwdId, deleteType); + Future deletePwdRequest( + String lockId, String keyboardPwdId, int deleteType) async { + PasswordKeyEntity entity = await ApiRepository.to + .deleteKeyboardPwd(lockId, keyboardPwdId, deleteType); if (entity.errorCode!.codeIsSuccessful) { Toast.show(msg: "删除成功"); mockNetworkDataRequest(); diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart index 9ae822f0..dcdfca78 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart @@ -90,18 +90,18 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { state.effectiveDateTime.value.millisecondsSinceEpoch.toString(); } var entity = await ApiRepository.to.getPasswordKey( - getFailureDateTime, - '0', - state.nameController.text, - getKeyType, - '0', - lockId, - '0', - getEffectiveDateTime, - '0', - state.loopStartHours.value, - state.loopEndHours.value, - 1); + endDate: getFailureDateTime, + isExclusive: '0', + keyboardPwdName: state.nameController.text, + keyboardPwdType: getKeyType, + keyboardPwdVersion: '0', + lockId: lockId, + operatorUid: '0', + startDate: getEffectiveDateTime, + timezoneRawOffSet: '0', + startHours: state.loopStartHours.value, + endHours: state.loopEndHours.value, + isCoerced: 1); if (entity.errorCode!.codeIsSuccessful) { print('获取密码成功'); state.isSendSuccess.value = true; diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index af5e9971..8985e9ee 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -362,19 +362,13 @@ class ApiProvider extends BaseProvider { Future getWifiLockServiceIpAndPort() => post(getWifiServiceIpURL.toUrl, jsonEncode({})); - Future passwordKeyList( - String keyStatus, - String lockId, - String operatorUid, - String pageNo, - String pageSize, - String searchStr) => + Future passwordKeyList(String keyStatus, String lockId, + String pageNo, String pageSize, String searchStr) => post( passwordKeyListURL.toUrl, jsonEncode({ 'keyStatus': keyStatus, 'lockId': lockId, - 'operatorUid': operatorUid, 'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr @@ -436,14 +430,16 @@ class ApiProvider extends BaseProvider { })); Future updateKeyboardPwd( - String lockId, - String keyboardPwdId, - String keyboardPwdName, - String newKeyboardPwd, - String startDate, - String endDate, - String changeType, - ) => + int lockId, + String keyboardPwdId, + String keyboardPwdName, + String newKeyboardPwd, + int startDate, + int endDate, + String changeType, + String isCoerced, + int hoursStart, + int hoursEnd) => post( updatePasswordKeyURL.toUrl, jsonEncode({ @@ -454,6 +450,9 @@ class ApiProvider extends BaseProvider { 'startDate': startDate, 'endDate': endDate, 'changeType': changeType, + 'isCoerced': isCoerced, + 'hoursStart': hoursStart, + 'hoursEnd': hoursEnd })); Future clearOperationRecord(String lockId) => diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index ee55448d..6276ef48 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -323,15 +323,10 @@ class ApiRepository { } //密码列表 - Future passwordKeyList( - String keyStatus, - String lockId, - String operatorUid, - String pageNo, - String pageSize, - String searchStr) async { + Future passwordKeyList(String keyStatus, String lockId, + String pageNo, String pageSize, String searchStr) async { final res = await apiProvider.passwordKeyList( - keyStatus, lockId, operatorUid, pageNo, pageSize, searchStr); + keyStatus, lockId, pageNo, pageSize, searchStr); return PasswordKeyListEntity.fromJson(res.body); } @@ -357,43 +352,47 @@ class ApiRepository { } // 获取所有锁设置信息 - Future getLockSettingInfoData({required String lockId}) async { + Future getLockSettingInfoData( + {required String lockId}) async { final res = await apiProvider.getLockSettingInfoData(lockId); return LockSetInfoEntity.fromJson(res.body); } // 删除锁 - Future deletOwnerLockData({required String lockId}) async { + Future deletOwnerLockData( + {required String lockId}) async { final res = await apiProvider.deletLockInfo(lockId); return LockListInfoEntity.fromJson(res.body); } // 删除钥匙 - Future deletOwnerKeyData({required String lockId, required String keyId}) async { + Future deletOwnerKeyData( + {required String lockId, required String keyId}) async { final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId); return LockListInfoEntity.fromJson(res.body); } // 检查账户密码 - Future checkLoginPassword({required String password}) async { + Future checkLoginPassword( + {required String password}) async { final res = await apiProvider.checkLoginPassword(password); return LockListInfoEntity.fromJson(res.body); } //获取密码 Future getPasswordKey( - String endDate, - String isExclusive, - String keyboardPwdName, - String keyboardPwdType, - String keyboardPwdVersion, - String lockId, - String operatorUid, - String startDate, - String timezoneRawOffSet, - int startHours, - int endHours, - int isCoerced) async { + {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 { final res = await apiProvider.getKeyboardPwd( endDate, isExclusive, @@ -427,16 +426,27 @@ class ApiRepository { //修改密码 Future updatePasswordKey( - String lockId, - String keyboardPwdId, - String keyboardPwdName, - String newKeyboardPwd, - String startDate, - String endDate, - String changeType, - ) async { - final res = await apiProvider.updateKeyboardPwd(lockId, keyboardPwdId, - keyboardPwdName, newKeyboardPwd, startDate, endDate, changeType); + {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); return PasswordKeyEntity.fromJson(res.body); }