feat:创建挂单数据库,和迁移文件
This commit is contained in:
1 parent
815cb2ac8b
commit
988247f3cd
7 files changed
+248
-3
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
part 'order_hold_bill_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "order_hold_bill")
|
||||
class OrderHoldBillEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 平台类型
|
||||
SysType sysType;
|
||||
|
||||
/// 订单列表json
|
||||
String? orderListJson;
|
||||
|
||||
/// 支付订单json
|
||||
String? userJson;
|
||||
|
||||
String? orderJson;
|
||||
|
||||
/// 创建时间
|
||||
DateTime createTime;
|
||||
|
||||
OrderHoldBillEntity({
|
||||
this.id,
|
||||
this.orderListJson,
|
||||
this.userJson,
|
||||
this.orderJson,
|
||||
required this.sysType,
|
||||
required this.createTime,
|
||||
});
|
||||
|
||||
factory OrderHoldBillEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$OrderHoldBillEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$OrderHoldBillEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'order_hold_bill_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
OrderHoldBillEntity _$OrderHoldBillEntityFromJson(Map<String, dynamic> json) =>
|
||||
OrderHoldBillEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
orderListJson: json['orderListJson'] as String?,
|
||||
userJson: json['userJson'] as String?,
|
||||
orderJson: json['orderJson'] as String?,
|
||||
sysType: $enumDecode(_$SysTypeEnumMap, json['sysType']),
|
||||
createTime: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OrderHoldBillEntityToJson(
|
||||
OrderHoldBillEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'sysType': _$SysTypeEnumMap[instance.sysType]!,
|
||||
'orderListJson': instance.orderListJson,
|
||||
'userJson': instance.userJson,
|
||||
'orderJson': instance.orderJson,
|
||||
'createTime': instance.createTime.toIso8601String(),
|
||||
};
|
||||
|
||||
const _$SysTypeEnumMap = {
|
||||
SysType.SUPERMARKET: 'SUPERMARKET',
|
||||
SysType.CANTEEN: 'CANTEEN',
|
||||
};
|
||||
Reference in new issue
Block a user