新增设置猫眼工作模式接口
新增设置自动亮屏接口及逻辑 新增设置亮屏持续时间接口及逻辑 新增逗留警告接口及逻辑处理 新增设置异常警告接口及逻辑处理
This commit is contained in:
parent
1ffe7d228e
commit
611ff5ee08
@ -26,16 +26,16 @@ class XSConstantMacro {
|
||||
// "110412" 已过期
|
||||
// "110408" 已删除
|
||||
// "110410" 已重置
|
||||
static int keyStatusNormalUse = 110401; // 正常使用
|
||||
static int keyStatusWaitReceive = 110402; // 待接收
|
||||
static int keyStatusNormalUse = 110401; // 正常使用
|
||||
static int keyStatusWaitReceive = 110402; // 待接收
|
||||
static int keyStatusWaitIneffective = 110403; // 待生效
|
||||
static int keyStatusFrozen = 110405; // 已冻结
|
||||
static int keyStatusExpired = 110412; // 已过期
|
||||
static int keyStatusDeleted = 110408; // 已删除
|
||||
static int keyStatusReset = 110410; // 已重置
|
||||
static int keyStatusFrozen = 110405; // 已冻结
|
||||
static int keyStatusExpired = 110412; // 已过期
|
||||
static int keyStatusDeleted = 110408; // 已删除
|
||||
static int keyStatusReset = 110410; // 已重置
|
||||
|
||||
static String getKeyStatusStr(int keyStatus){
|
||||
switch(keyStatus){
|
||||
static String getKeyStatusStr(int keyStatus) {
|
||||
switch (keyStatus) {
|
||||
case 110401:
|
||||
return "正常使用";
|
||||
case 110402:
|
||||
@ -54,10 +54,17 @@ class XSConstantMacro {
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
// 门锁事件类型 lockEventType 事件类型:0-全部事件;10-开门事件20-异常事件30-门铃事件40-视频事件
|
||||
static int lockEventTypeAll = 0;
|
||||
static int lockEventTypeOpenDoor = 10;
|
||||
static int lockEventTypeAbnormal = 20;
|
||||
static int lockEventTypeDoorbell = 30;
|
||||
static int lockEventTypeVideo = 40;
|
||||
|
||||
//猫眼工作模式
|
||||
static int catEyeWorkModePowerSaving = 1; //省电模式
|
||||
static int catEyeWorkModeStayCapture = 2; //逗留抓拍模式
|
||||
static int catEyeWorkModeRealTimeMonitoring = 3; //实时监控模式
|
||||
static int catEyeWorkModeCustom = 4; //自定义模式
|
||||
}
|
||||
|
||||
@ -1,7 +1,53 @@
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import 'catEyeSet_state.dart';
|
||||
|
||||
class CatEyeSetLogic extends BaseGetXController {
|
||||
final CatEyeSetState state = CatEyeSetState();
|
||||
|
||||
//设置自动亮屏
|
||||
void updateAutoLightScreenConfig() async {
|
||||
var entity = await ApiRepository.to.updateAutoLightScreenConfig(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
autoLightScreen: state.isAutoBright.value == true ? 1 : 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
}
|
||||
}
|
||||
|
||||
//设置自动亮屏
|
||||
void updateLightScreenTimeConfig() async {
|
||||
var entity = await ApiRepository.to.updateLightScreenTimeConfig(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
autoLightScreenTime:
|
||||
int.parse(state.selectBrightDuration.value.replaceAll('秒', '')),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
}
|
||||
}
|
||||
|
||||
//设置逗留警告
|
||||
void updateStayWarnConfig() async {
|
||||
var entity = await ApiRepository.to.updateStayWarnConfig(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
stayWarn: state.isStayWarning.value == true ? 1 : 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
}
|
||||
}
|
||||
|
||||
//设置异常警告
|
||||
void updateAbnormalWarnConfig() async {
|
||||
var entity = await ApiRepository.to.updateAbnormalWarnConfig(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
abnormalWarn: state.isExceptionWarning.value == true ? 1 : 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,12 +33,18 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: '猫眼工作模式',
|
||||
rightTitle: "",
|
||||
rightTitle: state.selectCatEyeWorkMode.value,
|
||||
allHeight: 70.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.catEyeWorkModePage);
|
||||
Get.toNamed(Routers.catEyeWorkModePage, arguments: {
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
})?.then((value) {
|
||||
if (value != null) {
|
||||
state.selectCatEyeWorkMode.value = value;
|
||||
}
|
||||
});
|
||||
}),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '自动亮屏',
|
||||
@ -94,15 +100,26 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
||||
onChanged: (value) {
|
||||
switch (clickIndex) {
|
||||
case 1: //自动亮屏
|
||||
state.isAutoBright.value = value;
|
||||
{
|
||||
state.isAutoBright.value = value;
|
||||
logic.updateAutoLightScreenConfig();
|
||||
}
|
||||
break;
|
||||
case 2: //逗留警告
|
||||
state.isStayWarning.value = value;
|
||||
{
|
||||
state.isStayWarning.value = value;
|
||||
logic.updateStayWarnConfig();
|
||||
}
|
||||
break;
|
||||
case 3: //异常警告
|
||||
state.isExceptionWarning.value = value;
|
||||
{
|
||||
state.isExceptionWarning.value = value;
|
||||
logic.updateAbnormalWarnConfig();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
print('clickIndex is not match');
|
||||
break;
|
||||
}
|
||||
},
|
||||
);
|
||||
@ -120,6 +137,7 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
||||
chooseCallback: (value) {
|
||||
state.selectBrightDuration.value =
|
||||
state.brightDurationTimeList[value];
|
||||
logic.updateLightScreenTimeConfig();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||
|
||||
class CatEyeSetState {
|
||||
var brightDurationTimeList = ['10秒', '15秒', '20秒'].obs;
|
||||
@ -6,4 +7,11 @@ class CatEyeSetState {
|
||||
var isAutoBright = false.obs; //自动亮屏
|
||||
var isStayWarning = false.obs; //逗留警告
|
||||
var isExceptionWarning = false.obs; //异常警告
|
||||
var lockSetInfoData = LockSetInfoData().obs;
|
||||
var selectCatEyeWorkMode = ''.obs; //猫眼工作模式
|
||||
|
||||
CatEyeSetState() {
|
||||
Map map = Get.arguments;
|
||||
lockSetInfoData.value = map["lockSetInfoData"];
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class CatEyeWorkModeLogic extends BaseGetXController {
|
||||
final CatEyeWorkModeState state = CatEyeWorkModeState();
|
||||
|
||||
//设置猫眼工作模式
|
||||
void updateCatEyeModeConfig() async {
|
||||
var entity = await ApiRepository.to.updateCatEyeModeConfig(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
catEyeConfig: {
|
||||
'catEyeMode': state.selectCatEyeWorkMode.value,
|
||||
'catEyeModeConfig': {
|
||||
'recordMode': state.recordMode.value,
|
||||
'recordStartTime': state.recordStartTime.value,
|
||||
'recordEndTime': state.recordEndTime.value,
|
||||
'detectionDistance': state.detectionDistance.value,
|
||||
'realTimeMode': state.realTimeMode.value,
|
||||
}
|
||||
},
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
@ -14,8 +16,8 @@ class CatEyeWorkModePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
||||
bool isCheck = false;
|
||||
List boolList = [true, false, false, false];
|
||||
final logic = Get.put(CatEyeWorkModeLogic());
|
||||
final state = Get.find<CatEyeWorkModeLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -30,44 +32,34 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView(
|
||||
'省电模式:\n',
|
||||
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下,满电可使用7-8个月',
|
||||
0,
|
||||
boolList[0]),
|
||||
_buildTipsView('省电模式:\n',
|
||||
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下,满电可使用7-8个月', 0),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView('逗留抓拍模式:\n',
|
||||
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下,满电可使用5~6个月。', 1),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView('实时监控模式:\n',
|
||||
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下,满电可使用2~4个月。', 2),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView(
|
||||
'逗留抓拍模式:\n',
|
||||
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下,满电可使用5~6个月。',
|
||||
1,
|
||||
boolList[1]),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView(
|
||||
'实时监控模式:\n',
|
||||
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下,满电可使用2~4个月。',
|
||||
2,
|
||||
boolList[2]),
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
_buildTipsView('自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。',
|
||||
3, boolList[3])
|
||||
'自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。', 3)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildTipsView(
|
||||
String titleStr, String subTitle, int clickIndex, bool isClick) {
|
||||
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: ScreenUtil().screenWidth - 40.w,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
||||
decoration: BoxDecoration(
|
||||
color: isClick
|
||||
color: state.boolList.value[clickIndex]
|
||||
? AppColors.blueViewBgColor
|
||||
: AppColors.greyBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
@ -77,7 +69,7 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
||||
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
|
||||
child: Row(
|
||||
children: [
|
||||
isClick
|
||||
state.boolList.value[clickIndex]
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
@ -89,7 +81,8 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
Expanded(
|
||||
child: _buildRichText(titleStr, subTitle, isClick),
|
||||
child: _buildRichText(
|
||||
titleStr, subTitle, state.boolList.value[clickIndex]),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
@ -128,11 +121,30 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
for (int i = 0; i < boolList.length; i++) {
|
||||
for (int i = 0; i < state.boolList.value.length; i++) {
|
||||
if (clickIndex == i) {
|
||||
boolList[clickIndex] = true;
|
||||
state.boolList.value[clickIndex] = true;
|
||||
switch (clickIndex) {
|
||||
case 0:
|
||||
state.selectCatEyeWorkMode.value =
|
||||
XSConstantMacro.catEyeWorkModePowerSaving;
|
||||
break;
|
||||
case 1:
|
||||
state.selectCatEyeWorkMode.value =
|
||||
XSConstantMacro.catEyeWorkModeStayCapture;
|
||||
break;
|
||||
case 2:
|
||||
state.selectCatEyeWorkMode.value =
|
||||
XSConstantMacro.catEyeWorkModeRealTimeMonitoring;
|
||||
break;
|
||||
case 3:
|
||||
state.selectCatEyeWorkMode.value =
|
||||
XSConstantMacro.catEyeWorkModeCustom;
|
||||
break;
|
||||
}
|
||||
logic.updateCatEyeModeConfig();
|
||||
} else {
|
||||
boolList[i] = false;
|
||||
state.boolList.value[i] = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||
|
||||
class CatEyeWorkModeState {
|
||||
var lockSetInfoData = LockSetInfoData().obs;
|
||||
var selectCatEyeWorkMode = 0.obs; //猫眼工作模式
|
||||
var boolList = [true, false, false, false].obs;
|
||||
var recordMode = 0.obs; //录像时段 0全天 1自定义时间
|
||||
//自定义时间需要填:recordStartTime与recordEndTime参数
|
||||
var recordStartTime = 0.obs; // 1709715049775,
|
||||
var recordEndTime = 0.obs; //1709715049775,
|
||||
var recordTime = 0.obs; //有人出现时录像
|
||||
var detectionDistance = 0.obs; //人体侦测距离
|
||||
var realTimeMode = 0.obs; //实时画面 0发生事件事查看 1实时查看
|
||||
|
||||
CatEyeWorkModeState() {
|
||||
Map map = Get.arguments;
|
||||
lockSetInfoData.value = map["lockSetInfoData"];
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
// 常开模式
|
||||
Obx(() => Visibility(
|
||||
visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||
// visible: true,
|
||||
// visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
|
||||
@ -380,7 +380,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.catEyeSetPage);
|
||||
Get.toNamed(Routers.catEyeSetPage, arguments: {
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
});
|
||||
})),
|
||||
// Obx(() =>
|
||||
//自动亮屏已包括至面容开锁模块
|
||||
|
||||
@ -176,4 +176,7 @@ abstract class Api {
|
||||
final String deletMessageURL = '/notifications/delete'; //删除消息
|
||||
|
||||
final String getVersionURL = '/app/getVersion'; //版本更新
|
||||
|
||||
final String updateCatEyeConfigURL =
|
||||
'/lockSetting/updateCatEyeConfig'; //设置猫眼工作模式
|
||||
}
|
||||
|
||||
@ -220,22 +220,20 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
||||
|
||||
Future<Response> lockRecordList(
|
||||
{
|
||||
required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String timezoneRawOffSet,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId
|
||||
}) =>
|
||||
{required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String timezoneRawOffSet,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId}) =>
|
||||
post(
|
||||
keyOperationRecordURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -358,9 +356,15 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 删除拥有的当前钥匙
|
||||
Future<Response> deletOwnerKeyInfo(String lockId, String keyId, int includeUnderlings) => post(
|
||||
deleteElectronicKeyURL.toUrl,
|
||||
jsonEncode({'lockId': lockId, 'keyId': keyId, 'includeUnderlings': includeUnderlings}));
|
||||
Future<Response> deletOwnerKeyInfo(
|
||||
String lockId, String keyId, int includeUnderlings) =>
|
||||
post(
|
||||
deleteElectronicKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'keyId': keyId,
|
||||
'includeUnderlings': includeUnderlings
|
||||
}));
|
||||
|
||||
// 检查账户密码
|
||||
Future<Response> checkLoginPassword(String password) => post(
|
||||
@ -527,13 +531,12 @@ class ApiProvider extends BaseProvider {
|
||||
'remoteEnable': remoteEnable
|
||||
}));
|
||||
|
||||
Future<Response> expireLockList(String pageNo, String pageSize) =>
|
||||
post(
|
||||
expireLockListURL.toUrl,
|
||||
jsonEncode({
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}));
|
||||
Future<Response> expireLockList(String pageNo, String pageSize) => post(
|
||||
expireLockListURL.toUrl,
|
||||
jsonEncode({
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}));
|
||||
|
||||
Future<Response> deleteKeyboardPwd(
|
||||
String lockId, String keyboardPwdId, int deleteType) =>
|
||||
@ -971,9 +974,9 @@ class ApiProvider extends BaseProvider {
|
||||
String isCoerced,
|
||||
String startDate,
|
||||
List weekDay,
|
||||
int fingerRight,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int fingerRight,
|
||||
int startTime,
|
||||
int endTime,
|
||||
) =>
|
||||
post(
|
||||
addFingerprintURL.toUrl,
|
||||
@ -1002,9 +1005,9 @@ class ApiProvider extends BaseProvider {
|
||||
String isCoerced,
|
||||
String fingerprintName,
|
||||
String changeType,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int fingerprintType) =>
|
||||
int startTime,
|
||||
int endTime,
|
||||
int fingerprintType) =>
|
||||
post(
|
||||
editFingerprintURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -1164,9 +1167,9 @@ class ApiProvider extends BaseProvider {
|
||||
String startDate,
|
||||
String isCoerced,
|
||||
List weekDay,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int cardRight,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int cardRight,
|
||||
) =>
|
||||
post(
|
||||
addICCardURL.toUrl,
|
||||
@ -1187,17 +1190,18 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 编辑ICCard
|
||||
Future<Response> editICCardData(
|
||||
String lockId,
|
||||
String cardId,
|
||||
String cardName,
|
||||
String startDate,
|
||||
String endDate,
|
||||
String isCoerced,
|
||||
List weekDay,
|
||||
String changeType,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int cardType,) =>
|
||||
String lockId,
|
||||
String cardId,
|
||||
String cardName,
|
||||
String startDate,
|
||||
String endDate,
|
||||
String isCoerced,
|
||||
List weekDay,
|
||||
String changeType,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int cardType,
|
||||
) =>
|
||||
post(
|
||||
editICCardURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -1568,12 +1572,58 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取最新版本号
|
||||
Future<Response> getVersionData(String brandName, String currentVersion) => post(
|
||||
getVersionURL.toUrl,
|
||||
Future<Response> getVersionData(String brandName, String currentVersion) =>
|
||||
post(
|
||||
getVersionURL.toUrl,
|
||||
jsonEncode({
|
||||
'brandName': brandName,
|
||||
'currentVersion': currentVersion,
|
||||
}));
|
||||
|
||||
// 设置猫眼工作模式
|
||||
Future<Response> updateCatEyeModeConfig(int lockId, Map catEyeConfig) => post(
|
||||
updateCatEyeConfigURL.toUrl,
|
||||
jsonEncode({
|
||||
'brandName': brandName,
|
||||
'currentVersion': currentVersion,
|
||||
'lockId': lockId,
|
||||
'catEyeConfig': catEyeConfig,
|
||||
}));
|
||||
|
||||
// 设置自动亮屏
|
||||
Future<Response> updateAutoLightScreenConfig(
|
||||
int lockId, int autoLightScreen) =>
|
||||
post(
|
||||
updateCatEyeConfigURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'autoLightScreen': autoLightScreen,
|
||||
}));
|
||||
|
||||
// 设置亮屏持续时间
|
||||
Future<Response> updateLightScreenTimeConfig(
|
||||
int lockId, int autoLightScreenTime) =>
|
||||
post(
|
||||
updateCatEyeConfigURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'autoLightScreenTime': autoLightScreenTime,
|
||||
}));
|
||||
|
||||
// 设置逗留警告
|
||||
Future<Response> updateStayWarnConfig(int lockId, int stayWarn) => post(
|
||||
updateCatEyeConfigURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'stayWarn': stayWarn,
|
||||
}));
|
||||
|
||||
// 设置异常警告
|
||||
Future<Response> updateAbnormalWarnConfig(int lockId, int abnormalWarn) =>
|
||||
post(
|
||||
updateCatEyeConfigURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'abnormalWarn': abnormalWarn,
|
||||
}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -191,37 +191,35 @@ class ApiRepository {
|
||||
|
||||
//钥匙详情-操作记录
|
||||
Future<KeyOperationRecordEntity> lockRecordList(
|
||||
{
|
||||
required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String timezoneRawOffSet,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId
|
||||
}) async {
|
||||
{required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String timezoneRawOffSet,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId}) async {
|
||||
final res = await apiProvider.lockRecordList(
|
||||
endDate:endDate,
|
||||
keyId:keyId,
|
||||
keyStatus:keyStatus,
|
||||
lockId:lockId,
|
||||
operatorUid:operatorUid,
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
startDate:startDate,
|
||||
recordType:recordType,
|
||||
searchStr:searchStr,
|
||||
timezoneRawOffSet:timezoneRawOffSet,
|
||||
keyboardPwdId:keyboardPwdId,
|
||||
cardId:cardId,
|
||||
fingerprintId:fingerprintId);
|
||||
endDate: endDate,
|
||||
keyId: keyId,
|
||||
keyStatus: keyStatus,
|
||||
lockId: lockId,
|
||||
operatorUid: operatorUid,
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize,
|
||||
startDate: startDate,
|
||||
recordType: recordType,
|
||||
searchStr: searchStr,
|
||||
timezoneRawOffSet: timezoneRawOffSet,
|
||||
keyboardPwdId: keyboardPwdId,
|
||||
cardId: cardId,
|
||||
fingerprintId: fingerprintId);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -384,8 +382,11 @@ class ApiRepository {
|
||||
|
||||
// 删除钥匙
|
||||
Future<LockListInfoEntity> deletOwnerKeyData(
|
||||
{required String lockId, required String keyId, required int includeUnderlings}) async {
|
||||
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId, includeUnderlings);
|
||||
{required String lockId,
|
||||
required String keyId,
|
||||
required int includeUnderlings}) async {
|
||||
final res =
|
||||
await apiProvider.deletOwnerKeyInfo(lockId, keyId, includeUnderlings);
|
||||
return LockListInfoEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -545,7 +546,8 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
//即将到期的锁列表
|
||||
Future<ExpireLockListEntity> expireLockList(String pageNo, String pageSize) async {
|
||||
Future<ExpireLockListEntity> expireLockList(
|
||||
String pageNo, String pageSize) async {
|
||||
final res = await apiProvider.expireLockList(pageNo, pageSize);
|
||||
return ExpireLockListEntity.fromJson(res.body);
|
||||
}
|
||||
@ -1148,18 +1150,28 @@ class ApiRepository {
|
||||
// 编辑指纹
|
||||
Future<LoginEntity> editFingerprintsData(
|
||||
{required String fingerprintId,
|
||||
required String lockId,
|
||||
required List weekDay,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isCoerced,
|
||||
required String fingerprintName,
|
||||
required String changeType,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int fingerprintType}) async {
|
||||
final res = await apiProvider.editFingerprintsData(fingerprintId, lockId,
|
||||
weekDay, startDate, endDate, isCoerced, fingerprintName, changeType, startTime, endTime, fingerprintType);
|
||||
required String lockId,
|
||||
required List weekDay,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isCoerced,
|
||||
required String fingerprintName,
|
||||
required String changeType,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int fingerprintType}) async {
|
||||
final res = await apiProvider.editFingerprintsData(
|
||||
fingerprintId,
|
||||
lockId,
|
||||
weekDay,
|
||||
startDate,
|
||||
endDate,
|
||||
isCoerced,
|
||||
fingerprintName,
|
||||
changeType,
|
||||
startTime,
|
||||
endTime,
|
||||
fingerprintType);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1316,26 +1328,48 @@ class ApiRepository {
|
||||
required int endTime,
|
||||
required int cardRight,
|
||||
}) async {
|
||||
final res = await apiProvider.addICCardData(lockId, endDate, cardName,
|
||||
cardNumber, cardType, addType, startDate, isCoerced, weekDay, startTime, endTime, cardRight);
|
||||
final res = await apiProvider.addICCardData(
|
||||
lockId,
|
||||
endDate,
|
||||
cardName,
|
||||
cardNumber,
|
||||
cardType,
|
||||
addType,
|
||||
startDate,
|
||||
isCoerced,
|
||||
weekDay,
|
||||
startTime,
|
||||
endTime,
|
||||
cardRight);
|
||||
return AddICCardEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 编辑IC卡
|
||||
Future<LoginEntity> editICCardData(
|
||||
{required String lockId,
|
||||
required String cardId,
|
||||
required String cardName,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isCoerced,
|
||||
required List weekDay,
|
||||
required String changeType,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int cardType,}) async {
|
||||
final res = await apiProvider.editICCardData(lockId, cardId, cardName,
|
||||
startDate, endDate, isCoerced, weekDay, changeType, startTime, endTime, cardType);
|
||||
Future<LoginEntity> editICCardData({
|
||||
required String lockId,
|
||||
required String cardId,
|
||||
required String cardName,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String isCoerced,
|
||||
required List weekDay,
|
||||
required String changeType,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int cardType,
|
||||
}) async {
|
||||
final res = await apiProvider.editICCardData(
|
||||
lockId,
|
||||
cardId,
|
||||
cardName,
|
||||
startDate,
|
||||
endDate,
|
||||
isCoerced,
|
||||
weekDay,
|
||||
changeType,
|
||||
startTime,
|
||||
endTime,
|
||||
cardType);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1586,11 +1620,47 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 获取版本号
|
||||
Future<VersionUndateEntity> getVersionData({
|
||||
required String brandName,
|
||||
required String currentVersion
|
||||
}) async {
|
||||
Future<VersionUndateEntity> getVersionData(
|
||||
{required String brandName, required String currentVersion}) async {
|
||||
final res = await apiProvider.getVersionData(brandName, currentVersion);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置猫眼工作模式
|
||||
Future<VersionUndateEntity> updateCatEyeModeConfig(
|
||||
{required int lockId, required Map catEyeConfig}) async {
|
||||
final res = await apiProvider.updateCatEyeModeConfig(lockId, catEyeConfig);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置自动亮屏
|
||||
Future<VersionUndateEntity> updateAutoLightScreenConfig(
|
||||
{required int lockId, required int autoLightScreen}) async {
|
||||
final res =
|
||||
await apiProvider.updateAutoLightScreenConfig(lockId, autoLightScreen);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置亮屏持续时间
|
||||
Future<VersionUndateEntity> updateLightScreenTimeConfig(
|
||||
{required int lockId, required int autoLightScreenTime}) async {
|
||||
final res = await apiProvider.updateLightScreenTimeConfig(
|
||||
lockId, autoLightScreenTime);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置逗留警告
|
||||
Future<VersionUndateEntity> updateStayWarnConfig(
|
||||
{required int lockId, required int stayWarn}) async {
|
||||
final res = await apiProvider.updateStayWarnConfig(lockId, stayWarn);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置异常警告
|
||||
Future<VersionUndateEntity> updateAbnormalWarnConfig(
|
||||
{required int lockId, required int abnormalWarn}) async {
|
||||
final res =
|
||||
await apiProvider.updateAbnormalWarnConfig(lockId, abnormalWarn);
|
||||
return VersionUndateEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user