voice_welcome_config_model.dart
2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* 商家语音欢迎致辞配置
* 对应接口:App.Seller.GetVoiceWelcomeConfig / App.Seller.SaveVoiceWelcomeConfig
*/
class VoiceWelcomeConfigModel {
String? isVoiceWelcome; //是否开启语音欢迎致辞 0/1
String? welcomeContent; //预订人语音欢迎致辞模板
String? inviteeSameAsReserver; //被请人播报是否与预订人一致 0/1
String? inviteeDefaultContent; //被请人默认语音欢迎致辞模板
String? inviteeSpecialContent; //被请人特殊用餐类型语音欢迎致辞模板
String? isInviteeSpecialEnabled; //是否启用特殊用餐类型语音播报 0/1
List<String>? specialReserveTypes; //已选特殊用餐类型
List<String>? reserveTypeOptions; //全部用餐类型选项
List<VoiceWelcomePlaceholderModel>? placeholderButtons; //可变字段按钮
VoiceWelcomeConfigModel(
{this.isVoiceWelcome,
this.welcomeContent,
this.inviteeSameAsReserver,
this.inviteeDefaultContent,
this.inviteeSpecialContent,
this.isInviteeSpecialEnabled,
this.specialReserveTypes,
this.reserveTypeOptions,
this.placeholderButtons});
VoiceWelcomeConfigModel.fromJson(Map<String, dynamic> json) {
isVoiceWelcome = json['is_voice_welcome']?.toString();
welcomeContent = json['welcome_content']?.toString();
inviteeSameAsReserver = json['invitee_same_as_reserver']?.toString();
inviteeDefaultContent = json['invitee_default_content']?.toString();
inviteeSpecialContent = json['invitee_special_content']?.toString();
isInviteeSpecialEnabled =
json['is_invitee_special_enabled']?.toString();
if (json['special_reserve_types'] is List) {
specialReserveTypes = (json['special_reserve_types'] as List)
.map((e) => e.toString())
.toList();
}
if (json['reserve_type_options'] is List) {
reserveTypeOptions =
(json['reserve_type_options'] as List).map((e) => e.toString()).toList();
}
if (json['placeholder_buttons'] is List) {
placeholderButtons = [];
(json['placeholder_buttons'] as List).forEach((v) {
placeholderButtons!.add(
VoiceWelcomePlaceholderModel.fromJson(v as Map<String, dynamic>));
});
}
}
}
///可变字段按钮(如 年月日 -> {预订日期})
class VoiceWelcomePlaceholderModel {
String? name;
String? placeholder;
VoiceWelcomePlaceholderModel({this.name, this.placeholder});
VoiceWelcomePlaceholderModel.fromJson(Map<String, dynamic> json) {
name = json['name']?.toString();
placeholder = json['placeholder']?.toString();
}
}