Daisy e6592bf06b 1,新增邮件类型选择公用组件
2,新增获取电子钥匙通知模版API对接
3,完善电子钥匙发送成功后邮件通知相关页面及逻辑
4,根据后台返回电子钥匙类型显示短信、邮件通知
2024-06-11 17:55:00 +08:00

26 lines
1.1 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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();
}
}
}