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