feat: 更新广播间隔、数据库版本及广播逻辑

- 将广播间隔从10分钟缩短至3分钟
- 更新数据库版本至2,并调整相关实体和查询逻辑
- 修复广播记录保存和查询时的字段初始化问题
- 在广播消息中添加时间段类型字段
- 优化广播记录的UI显示和操作逻辑
This commit is contained in:
dzc committed 2025-04-23 15:51:00 +08:00
1 parent 45c2ea384d
commit cc98644cb5
13 files changed
+89 -44

No files matched your search

@@ -15,7 +15,7 @@ class BroadcastEntity {
String content;
/// 当前广播次数
int broadcastCount = 0;
int broadcastCount;
/// 最大广播次数
int broadcastMaxCount;
@@ -24,7 +24,7 @@ class BroadcastEntity {
bool isBroadcast;
/// 是否完成
bool isDone = false;
bool isDone;
/// 完成时间
DateTime? isDoneTime;
@@ -51,7 +51,7 @@ class BroadcastEntity {
ProductHourType? hourType;
/// 手动开关
bool enable = true;
bool enable;
/// 创建时间
DateTime createTime;
@@ -59,8 +59,10 @@ class BroadcastEntity {
BroadcastEntity({
this.id,
required this.content,
required this.broadcastCount,
required this.broadcastMaxCount,
required this.isBroadcast,
required this.isDone,
required this.createTime,
required this.serviceCode,
required this.userId,
@@ -68,6 +70,8 @@ class BroadcastEntity {
required this.userMobile,
required this.productDesc,
required this.payPrice,
this.hourType,
required this.enable,
});
factory BroadcastEntity.fromJson(Map<String, dynamic> json) =>
@@ -10,8 +10,10 @@ BroadcastEntity _$BroadcastEntityFromJson(Map<String, dynamic> json) =>
BroadcastEntity(
id: (json['id'] as num?)?.toInt(),
content: json['content'] as String,
broadcastCount: (json['broadcastCount'] as num).toInt(),
broadcastMaxCount: (json['broadcastMaxCount'] as num).toInt(),
isBroadcast: json['isBroadcast'] as bool,
isDone: json['isDone'] as bool,
createTime: DateTime.parse(json['createTime'] as String),
serviceCode: json['serviceCode'] as String,
userId: json['userId'] as String,
@@ -19,15 +21,11 @@ BroadcastEntity _$BroadcastEntityFromJson(Map<String, dynamic> json) =>
userMobile: json['userMobile'] as String,
productDesc: json['productDesc'] as String,
payPrice: (json['payPrice'] as num).toInt(),
)
..broadcastCount = (json['broadcastCount'] as num).toInt()
..isDone = json['isDone'] as bool
..isDoneTime = json['isDoneTime'] == null
? null
: DateTime.parse(json['isDoneTime'] as String)
..hourType =
$enumDecodeNullable(_$ProductHourTypeEnumMap, json['hourType'])
..enable = json['enable'] as bool;
hourType: $enumDecodeNullable(_$ProductHourTypeEnumMap, json['hourType']),
enable: json['enable'] as bool,
)..isDoneTime = json['isDoneTime'] == null
? null
: DateTime.parse(json['isDoneTime'] as String);
Map<String, dynamic> _$BroadcastEntityToJson(BroadcastEntity instance) =>
<String, dynamic>{