26 lines
1.1 KiB
Dart
26 lines
1.1 KiB
Dart
|
|
import 'package:get_storage/get_storage.dart';
|
|||
|
|
import 'package:star_lock/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_entity.dart';
|
|||
|
|
import 'package:star_lock/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_state.dart';
|
|||
|
|
import 'package:star_lock/network/api_repository.dart';
|
|||
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|||
|
|
import 'package:star_lock/tools/commonDataManage.dart';
|
|||
|
|
|
|||
|
|
class SendEmailNotificationLogic extends BaseGetXController {
|
|||
|
|
final SendEmailNotificationState state = SendEmailNotificationState();
|
|||
|
|
|
|||
|
|
//获取电子钥匙通知模板 渠道:1短信 2邮箱
|
|||
|
|
Future<void> getKeyNoticeTemplate() async {
|
|||
|
|
final SendEmailNotificationEntity entity =
|
|||
|
|
await ApiRepository.to.getKeyNoticeTemplate(
|
|||
|
|
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
|||
|
|
keyId: CommonDataManage().currentKeyInfo.keyId ?? 0,
|
|||
|
|
channelType: 2,
|
|||
|
|
);
|
|||
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|||
|
|
state.emailTemplateList.value =
|
|||
|
|
entity.data?.list ?? <EmailNotificationItem>[];
|
|||
|
|
state.emailTemplateList.refresh();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|