feat:恢复 http 日志打印
This commit is contained in:
parent
6c7e96d2cb
commit
624a43fde2
@ -4,6 +4,7 @@ import 'package:flutter_slidable/flutter_slidable.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_logic.dart';
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_logic.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
@ -25,8 +26,8 @@ class AuthorizedAdminListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||||
final logic = Get.put(AuthorizedAdminListLogic());
|
final AuthorizedAdminListLogic logic = Get.put(AuthorizedAdminListLogic());
|
||||||
final state = Get.find<AuthorizedAdminListLogic>().state;
|
final AuthorizedAdminListState state = Get.find<AuthorizedAdminListLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -37,7 +38,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
|
|
||||||
Future<void> mockRequest() async {
|
Future<void> mockRequest() async {
|
||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@ -63,7 +64,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
@ -72,7 +73,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
btnName: TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(context, Routers.authorizedAdminPage)
|
Navigator.pushNamed(context, Routers.authorizedAdminPage)
|
||||||
.then((val) {
|
.then((Object? val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
mockRequest();
|
mockRequest();
|
||||||
@ -89,14 +90,14 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.itemDataList.value.isEmpty
|
return Obx(() => state.itemDataList.isEmpty
|
||||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - 90)
|
||||||
: SlidableAutoCloseBehavior(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (BuildContext c, int index) {
|
||||||
ElectronicKeyListItem indexEntity =
|
final ElectronicKeyListItem indexEntity =
|
||||||
state.itemDataList.value[index];
|
state.itemDataList[index];
|
||||||
String useDateStr = ''; //使用期限
|
String useDateStr = ''; //使用期限
|
||||||
String keyStatus = ''; //钥匙状态
|
String keyStatus = ''; //钥匙状态
|
||||||
|
|
||||||
@ -116,16 +117,16 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key: ValueKey(indexEntity.keyId),
|
key: ValueKey<int?>(indexEntity.keyId),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: <Widget>[
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context) {
|
onPressed: (BuildContext context) {
|
||||||
ShowTipView()
|
ShowTipView()
|
||||||
.showDeleteAdministratorIsHaveAllDataDialog(
|
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||||
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (bool isAllData) {
|
||||||
logic.deleteKeyRequest(indexEntity.keyId.toString(),
|
logic.deleteKeyRequest(indexEntity.keyId.toString(),
|
||||||
isAllData ? 1 : 0);
|
isAllData ? 1 : 0);
|
||||||
});
|
});
|
||||||
@ -145,9 +146,9 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
isAdminKey, () {
|
isAdminKey, () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.electronicKeyDetailPage,
|
context, Routers.electronicKeyDetailPage,
|
||||||
arguments: {
|
arguments: <String, ElectronicKeyListItem>{
|
||||||
"itemData": indexEntity,
|
'itemData': indexEntity,
|
||||||
}).then((val) {
|
}).then((Object? val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
logic.mockNetworkDataRequest();
|
logic.mockNetworkDataRequest();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@ -172,14 +173,14 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
|
|
||||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
final DateTime startDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
DateTime endDateStr =
|
final DateTime endDateStr =
|
||||||
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
useDateStr =
|
useDateStr =
|
||||||
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
useDateStr = "永久";
|
useDateStr = '永久';
|
||||||
}
|
}
|
||||||
return useDateStr;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
@ -192,7 +193,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
avatarURL,
|
avatarURL,
|
||||||
@ -203,13 +204,13 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 110.w - 100.w,
|
width: 1.sw - 110.w - 100.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(receiveUser,
|
child: Text(receiveUser,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@ -231,7 +232,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
useDate,
|
useDate,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -0,0 +1,50 @@
|
|||||||
|
class NoticeTemplateEntity {
|
||||||
|
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
NoticeTemplateEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
NoticeTemplateEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
if (json['data'] is Map) {
|
||||||
|
data = Data.fromJson(json['data']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
data['data'] = this.data;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
List<int>? userNos = [];
|
||||||
|
|
||||||
|
Data({
|
||||||
|
this.userNos,
|
||||||
|
});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['userNos'] is List) {
|
||||||
|
json['userNos'].forEach((element) {
|
||||||
|
userNos?.add(element);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['userNos'] = userNos;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,19 +2,21 @@ import 'dart:ffi';
|
|||||||
|
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
|
|
||||||
import 'volumeAuthorizationLock_state.dart';
|
import 'volumeAuthorizationLock_state.dart';
|
||||||
|
|
||||||
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
||||||
final state = VolumeAuthorizationLockState();
|
final VolumeAuthorizationLockState state = VolumeAuthorizationLockState();
|
||||||
|
|
||||||
//发送批量授权管理员
|
//发送批量授权管理员
|
||||||
Future<void> addAuthorizedAdminRequest() async {
|
Future<void> addAuthorizedAdminRequest() async {
|
||||||
String getFailureDateTime = '0';
|
String getFailureDateTime = '0';
|
||||||
String getEffectiveDateTime = '0';
|
String getEffectiveDateTime = '0';
|
||||||
if (state.selectWidgetType == '1') {
|
if (state.selectWidgetType.value == '1') {
|
||||||
getFailureDateTime =
|
getFailureDateTime =
|
||||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||||
getEffectiveDateTime =
|
getEffectiveDateTime =
|
||||||
@ -25,11 +27,11 @@ class VolumeAuthorizationLockLogic extends BaseGetXController {
|
|||||||
showToast('请选择锁'.tr);
|
showToast('请选择锁'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.addAuthorizedAdmin(
|
final KeyDetailEntity entity = await ApiRepository.to.addAuthorizedAdmin(
|
||||||
createUser: state.isCreateUser.value ? '1' : '0',
|
createUser: state.isCreateUser.value ? '1' : '0',
|
||||||
endDate: getFailureDateTime,
|
endDate: getFailureDateTime,
|
||||||
isRemoteUnlock: '0',
|
isRemoteUnlock: '0',
|
||||||
keyGroupIdList: [],
|
keyGroupIdList: <dynamic>[],
|
||||||
lockIdList: state.lockIdList.value,
|
lockIdList: state.lockIdList.value,
|
||||||
name: state.keyNameController.text,
|
name: state.keyNameController.text,
|
||||||
startDate: getEffectiveDateTime,
|
startDate: getEffectiveDateTime,
|
||||||
@ -49,4 +51,14 @@ class VolumeAuthorizationLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//发送消息
|
||||||
|
Future<void> sendMsg({required bool isPhone}) async {
|
||||||
|
if (isPhone) {
|
||||||
|
} else {}
|
||||||
|
var entity = await ApiRepository.to.getNoticeTemplate(
|
||||||
|
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||||
|
keyId: CommonDataManage().currentKeyInfo.keyId!,
|
||||||
|
channelType: 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -181,7 +181,7 @@ class _VolumeAuthorizationLockPageState
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
||||||
rightTitle: state.lockIdList.value.isEmpty
|
rightTitle: state.lockIdList.isEmpty
|
||||||
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
||||||
: state.lockIdList.length.toString(),
|
: state.lockIdList.length.toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
@ -190,11 +190,12 @@ class _VolumeAuthorizationLockPageState
|
|||||||
arguments: <String, String>{'keyLimits': '1'})
|
arguments: <String, String>{'keyLimits': '1'})
|
||||||
.then((Object? value) {
|
.then((Object? value) {
|
||||||
//得到选中的锁ID列表
|
//得到选中的锁ID列表
|
||||||
if (value != null) {
|
if (value is Map<String, dynamic> && value['selectLockIdList'] is List) {
|
||||||
value as Map<String, dynamic>;
|
state.lockIdList.clear();
|
||||||
state.lockIdList.value = value['selectLockIdList'];
|
value['selectLockIdList'].forEach((element) {
|
||||||
|
state.lockIdList.add(element);
|
||||||
// setState(() {});
|
});
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -211,13 +212,6 @@ class _VolumeAuthorizationLockPageState
|
|||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: _onlyManageYouCreatesUserSwitch())),
|
child: _onlyManageYouCreatesUserSwitch())),
|
||||||
|
|
||||||
// CommonItem(
|
|
||||||
// leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
|
||||||
// rightTitle: '',
|
|
||||||
// isHaveRightWidget: true,
|
|
||||||
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch()),
|
|
||||||
// action: () {}),
|
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -375,31 +369,10 @@ class _VolumeAuthorizationLockPageState
|
|||||||
btnName: '微信通知',
|
btnName: '微信通知',
|
||||||
onClick: () {},
|
onClick: () {},
|
||||||
),
|
),
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
OutLineBtn(
|
|
||||||
btnName: '标记为已入住',
|
|
||||||
onClick: () {},
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CupertinoSwitch _switch() {
|
|
||||||
// return CupertinoSwitch(
|
|
||||||
// activeColor: CupertinoColors.activeBlue,
|
|
||||||
// trackColor: CupertinoColors.systemGrey5,
|
|
||||||
// thumbColor: CupertinoColors.white,
|
|
||||||
// value: state.isRemoteUnlock.value,
|
|
||||||
// onChanged: (bool value) {
|
|
||||||
// setState(() {
|
|
||||||
// _isRemoteUnlock = !_isRemoteUnlock;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
//仅管理自己创建的用户
|
//仅管理自己创建的用户
|
||||||
CupertinoSwitch _onlyManageYouCreatesUserSwitch() {
|
CupertinoSwitch _onlyManageYouCreatesUserSwitch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
@ -407,7 +380,7 @@ class _VolumeAuthorizationLockPageState
|
|||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.onlyManageYouCreatesUser.value,
|
value: state.onlyManageYouCreatesUser.value,
|
||||||
onChanged: (value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.onlyManageYouCreatesUser.value =
|
state.onlyManageYouCreatesUser.value =
|
||||||
!state.onlyManageYouCreatesUser.value;
|
!state.onlyManageYouCreatesUser.value;
|
||||||
|
|||||||
@ -235,4 +235,6 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getUserNoList = '/key/getUserNoList'; //获取指定锁下所有userNo
|
final String getUserNoList = '/key/getUserNoList'; //获取指定锁下所有userNo
|
||||||
|
|
||||||
|
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -374,12 +374,15 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// 获取锁信息列表
|
// 获取锁信息列表
|
||||||
Future<Response> getStarLockListInfo(int pageNo, int pageSize,{bool isUnShowLoading = true}) => post(
|
Future<Response> getStarLockListInfo(int pageNo, int pageSize,
|
||||||
getStarLockInfoURL.toUrl,
|
{bool isUnShowLoading = true}) =>
|
||||||
jsonEncode({
|
post(
|
||||||
"pageNo": pageNo,
|
getStarLockInfoURL.toUrl,
|
||||||
'pageSize': pageSize,
|
jsonEncode({
|
||||||
}),isUnShowLoading: isUnShowLoading);
|
"pageNo": pageNo,
|
||||||
|
'pageSize': pageSize,
|
||||||
|
}),
|
||||||
|
isUnShowLoading: isUnShowLoading);
|
||||||
|
|
||||||
// 获取所有锁设置信息
|
// 获取所有锁设置信息
|
||||||
Future<Response> getLockSettingInfoData(String lockId) => post(
|
Future<Response> getLockSettingInfoData(String lockId) => post(
|
||||||
@ -2078,6 +2081,17 @@ class ApiProvider extends BaseProvider {
|
|||||||
// 获取指定锁下所有userNo
|
// 获取指定锁下所有userNo
|
||||||
Future<Response> getLockUserNoList(int lockId) =>
|
Future<Response> getLockUserNoList(int lockId) =>
|
||||||
post(getUserNoList.toUrl, jsonEncode({'lockId': lockId}));
|
post(getUserNoList.toUrl, jsonEncode({'lockId': lockId}));
|
||||||
|
|
||||||
|
// 获取短信或者邮箱模板
|
||||||
|
Future<Response<dynamic>> getNoticeTemplate(
|
||||||
|
int lockId, int keyId, int channelType) =>
|
||||||
|
post(
|
||||||
|
getNoticeTemplateURL.toUrl,
|
||||||
|
jsonEncode(<String, int>{
|
||||||
|
'lockId': lockId,
|
||||||
|
'keyId': keyId,
|
||||||
|
'channelType': channelType,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -2112,4 +2112,15 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.getLockUserNoList(lockId);
|
final res = await apiProvider.getLockUserNoList(lockId);
|
||||||
return LockUserNoListEntity.fromJson(res.body);
|
return LockUserNoListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测certifyId是否完成认证
|
||||||
|
Future<LockUserNoListEntity> getNoticeTemplate({
|
||||||
|
required int lockId,
|
||||||
|
required int keyId,
|
||||||
|
required int channelType,
|
||||||
|
}) async {
|
||||||
|
final Response<dynamic> res =
|
||||||
|
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
||||||
|
return LockUserNoListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import 'package:get/get_connect/http/src/request/request.dart';
|
|||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
|
||||||
FutureOr<dynamic> responseLogInterceptor(Request request, Response response) {
|
FutureOr<dynamic> responseLogInterceptor(Request request, Response response) {
|
||||||
// AppLog.log('HTTP request:${request.url}\n RESPONSE => stataCode:${response.statusCode} ${response.bodyString}'); // \n ${response.headers}
|
AppLog.log('HTTP request:${request.url}\n RESPONSE => stataCode:${response.statusCode} ${response.bodyString}'); // \n ${response.headers}
|
||||||
EasyLoading.dismiss(animation: true);
|
EasyLoading.dismiss(animation: true);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user