feat:预定广播
This commit is contained in:
1 parent
fa90df8d9d
commit
691fb68d53
13 files changed
+341
-1
No files matched your search
@@ -8,6 +8,7 @@ enum MqtActionEnum implements BaseEnum {
|
||||
SUPERMARKET_CLASSIFY("50", "超市分类变化"),
|
||||
PRINT("60", "打印变化"),
|
||||
FACE("70", "人脸变化"),
|
||||
TAKE_FOOD_BROADCAST("80", "定餐广播"),
|
||||
;
|
||||
|
||||
@override
|
||||
|
||||
@@ -61,3 +61,54 @@ class MqttInvoiceMsg {
|
||||
|
||||
Map<String, dynamic> toJson() => _$MqttInvoiceMsgToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class MqttTakeFoodBroadcastMsg {
|
||||
/// 发送硬件的topic
|
||||
String topic;
|
||||
|
||||
/// 用户id
|
||||
String userId;
|
||||
|
||||
/// 用户id
|
||||
String username;
|
||||
|
||||
/// 用户id
|
||||
String userMobile;
|
||||
|
||||
/// 广播id
|
||||
String id;
|
||||
|
||||
/// 预定标题
|
||||
String title;
|
||||
|
||||
/// 广播内容
|
||||
String content;
|
||||
|
||||
/// 最大广播次数
|
||||
int broadcastMaxCount;
|
||||
|
||||
/// 商品介绍
|
||||
String productDesc;
|
||||
|
||||
/// 支付价格
|
||||
int payPrice;
|
||||
|
||||
MqttTakeFoodBroadcastMsg({
|
||||
required this.topic,
|
||||
required this.userId,
|
||||
required this.username,
|
||||
required this.userMobile,
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.content,
|
||||
required this.broadcastMaxCount,
|
||||
required this.productDesc,
|
||||
required this.payPrice,
|
||||
});
|
||||
|
||||
factory MqttTakeFoodBroadcastMsg.fromJson(Map<String, dynamic> json) =>
|
||||
_$MqttTakeFoodBroadcastMsgFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MqttTakeFoodBroadcastMsgToJson(this);
|
||||
}
|
||||
@@ -22,6 +22,7 @@ const _$MqtActionEnumEnumMap = {
|
||||
MqtActionEnum.SUPERMARKET_CLASSIFY: 'SUPERMARKET_CLASSIFY',
|
||||
MqtActionEnum.PRINT: 'PRINT',
|
||||
MqtActionEnum.FACE: 'FACE',
|
||||
MqtActionEnum.TAKE_FOOD_BROADCAST: 'TAKE_FOOD_BROADCAST',
|
||||
};
|
||||
|
||||
MqttInvoiceMsg _$MqttInvoiceMsgFromJson(Map<String, dynamic> json) =>
|
||||
@@ -45,3 +46,33 @@ Map<String, dynamic> _$MqttInvoiceMsgToJson(MqttInvoiceMsg instance) =>
|
||||
'pic': instance.pic,
|
||||
'isGlobalFace': instance.isGlobalFace,
|
||||
};
|
||||
|
||||
MqttTakeFoodBroadcastMsg _$MqttTakeFoodBroadcastMsgFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
MqttTakeFoodBroadcastMsg(
|
||||
topic: json['topic'] as String,
|
||||
userId: json['userId'] as String,
|
||||
username: json['username'] as String,
|
||||
userMobile: json['userMobile'] as String,
|
||||
id: json['id'] as String,
|
||||
title: json['title'] as String,
|
||||
content: json['content'] as String,
|
||||
broadcastMaxCount: (json['broadcastMaxCount'] as num).toInt(),
|
||||
productDesc: json['productDesc'] as String,
|
||||
payPrice: (json['payPrice'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$MqttTakeFoodBroadcastMsgToJson(
|
||||
MqttTakeFoodBroadcastMsg instance) =>
|
||||
<String, dynamic>{
|
||||
'topic': instance.topic,
|
||||
'userId': instance.userId,
|
||||
'username': instance.username,
|
||||
'userMobile': instance.userMobile,
|
||||
'id': instance.id,
|
||||
'title': instance.title,
|
||||
'content': instance.content,
|
||||
'broadcastMaxCount': instance.broadcastMaxCount,
|
||||
'productDesc': instance.productDesc,
|
||||
'payPrice': instance.payPrice,
|
||||
};
|
||||
Reference in new issue
Block a user