init
This commit is contained in:
commit
295b4058be
243 files changed
+19832
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/models/index.dart';
|
||||
|
||||
part 'classify_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "classify")
|
||||
class ClassifyEntity extends Equatable {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 服务端唯一标识
|
||||
String serviceUniqueCode;
|
||||
|
||||
/// 平台类型
|
||||
SysType sysType;
|
||||
|
||||
/// 分类名
|
||||
String name;
|
||||
|
||||
/// 用餐类型,早餐、中餐、晚餐
|
||||
String categoryType;
|
||||
|
||||
/// 排序 倒序排列
|
||||
int sort;
|
||||
|
||||
/// 创建时间
|
||||
DateTime createTime;
|
||||
|
||||
/// 同步时间
|
||||
DateTime updateTime;
|
||||
|
||||
/// 是否删除
|
||||
bool delFlag;
|
||||
|
||||
ClassifyEntity({
|
||||
this.id,
|
||||
required this.serviceUniqueCode,
|
||||
required this.sysType,
|
||||
required this.name,
|
||||
required this.categoryType,
|
||||
required this.sort,
|
||||
required this.createTime,
|
||||
required this.updateTime,
|
||||
required this.delFlag,
|
||||
});
|
||||
|
||||
factory ClassifyEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ClassifyEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ClassifyEntityToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
serviceUniqueCode,
|
||||
sysType,
|
||||
name,
|
||||
categoryType,
|
||||
sort,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'classify_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ClassifyEntity _$ClassifyEntityFromJson(Map<String, dynamic> json) =>
|
||||
ClassifyEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
serviceUniqueCode: json['serviceUniqueCode'] as String,
|
||||
sysType: $enumDecode(_$SysTypeEnumMap, json['sysType']),
|
||||
name: json['name'] as String,
|
||||
categoryType: json['categoryType'] as String,
|
||||
sort: (json['sort'] as num).toInt(),
|
||||
createTime: DateTime.parse(json['createTime'] as String),
|
||||
updateTime: DateTime.parse(json['updateTime'] as String),
|
||||
delFlag: json['delFlag'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ClassifyEntityToJson(ClassifyEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'serviceUniqueCode': instance.serviceUniqueCode,
|
||||
'sysType': _$SysTypeEnumMap[instance.sysType]!,
|
||||
'name': instance.name,
|
||||
'categoryType': instance.categoryType,
|
||||
'sort': instance.sort,
|
||||
'createTime': instance.createTime.toIso8601String(),
|
||||
'updateTime': instance.updateTime.toIso8601String(),
|
||||
'delFlag': instance.delFlag,
|
||||
};
|
||||
|
||||
const _$SysTypeEnumMap = {
|
||||
SysType.supermarket: 'supermarket',
|
||||
SysType.canteen: 'canteen',
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'face_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "face")
|
||||
class FaceEntity extends Equatable {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 用户id
|
||||
String userId;
|
||||
|
||||
/// 样本id
|
||||
String sampleId;
|
||||
|
||||
/// 用户名
|
||||
String userName;
|
||||
|
||||
/// 部门id
|
||||
String? deptId;
|
||||
|
||||
/// 部门名
|
||||
String? deptName;
|
||||
|
||||
/// 图片路径
|
||||
String imagePath;
|
||||
|
||||
/// 本地位置
|
||||
String? path;
|
||||
|
||||
/// 人脸模型数据
|
||||
List<dynamic>? faceModel;
|
||||
|
||||
/// 创建时间
|
||||
DateTime? createTime;
|
||||
|
||||
/// 同步时间
|
||||
DateTime? updateTime;
|
||||
|
||||
FaceEntity({
|
||||
this.id,
|
||||
required this.userId,
|
||||
required this.sampleId,
|
||||
required this.userName,
|
||||
this.deptId,
|
||||
this.deptName,
|
||||
required this.imagePath,
|
||||
this.path,
|
||||
this.faceModel,
|
||||
this.createTime,
|
||||
this.updateTime,
|
||||
});
|
||||
|
||||
factory FaceEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$FaceEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$FaceEntityToJson(this);
|
||||
|
||||
@override
|
||||
List<Object> get props => [userId, sampleId, userName, imagePath];
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'face_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
FaceEntity _$FaceEntityFromJson(Map<String, dynamic> json) => FaceEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
userId: json['userId'] as String,
|
||||
sampleId: json['sampleId'] as String,
|
||||
userName: json['userName'] as String,
|
||||
deptId: json['deptId'] as String?,
|
||||
deptName: json['deptName'] as String?,
|
||||
imagePath: json['imagePath'] as String,
|
||||
path: json['path'] as String?,
|
||||
faceModel: json['faceModel'] as List<dynamic>?,
|
||||
createTime: json['createTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createTime'] as String),
|
||||
updateTime: json['updateTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updateTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$FaceEntityToJson(FaceEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'userId': instance.userId,
|
||||
'sampleId': instance.sampleId,
|
||||
'userName': instance.userName,
|
||||
'deptId': instance.deptId,
|
||||
'deptName': instance.deptName,
|
||||
'imagePath': instance.imagePath,
|
||||
'path': instance.path,
|
||||
'faceModel': instance.faceModel,
|
||||
'createTime': instance.createTime?.toIso8601String(),
|
||||
'updateTime': instance.updateTime?.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,99 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
part 'order_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "order_record")
|
||||
class OrderEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 唯一code
|
||||
String uniqueCode;
|
||||
|
||||
/// 服务端唯一标识
|
||||
String serviceUniqueCode;
|
||||
|
||||
/// 平台类型
|
||||
SysType sysType;
|
||||
|
||||
/// 用户唯一标识
|
||||
String userCode;
|
||||
|
||||
/// 用户名
|
||||
String? username;
|
||||
|
||||
/// 订单用餐类型:早、中、晚
|
||||
String? hourType;
|
||||
|
||||
/// 购物车的总金额
|
||||
int price;
|
||||
|
||||
/// 购物车额外金额
|
||||
int extraPrice;
|
||||
|
||||
/// 结算总金额
|
||||
int payPrice;
|
||||
|
||||
/// 钱包id
|
||||
String? walletId;
|
||||
|
||||
/// 订单类型渠道id
|
||||
String? orderSourceTypeId;
|
||||
|
||||
/// 订单类型
|
||||
OrderType type;
|
||||
|
||||
/// 订单状态
|
||||
OrderStatus status;
|
||||
|
||||
/// 支付方式
|
||||
OrderPayType payType;
|
||||
|
||||
/// 商品描述
|
||||
String? productDesc;
|
||||
|
||||
/// 商品总数量 食堂特有
|
||||
int count;
|
||||
|
||||
/// 重量 超市特有
|
||||
double weight;
|
||||
|
||||
/// 支付时间
|
||||
DateTime? payTime;
|
||||
|
||||
/// 创建时间
|
||||
DateTime createTime;
|
||||
|
||||
OrderEntity({
|
||||
this.id,
|
||||
required this.uniqueCode,
|
||||
required this.serviceUniqueCode,
|
||||
required this.sysType,
|
||||
required this.userCode,
|
||||
this.username,
|
||||
this.hourType,
|
||||
required this.price,
|
||||
required this.extraPrice,
|
||||
required this.payPrice,
|
||||
this.walletId,
|
||||
this.orderSourceTypeId,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.payType,
|
||||
this.productDesc,
|
||||
required this.count,
|
||||
required this.weight,
|
||||
this.payTime,
|
||||
required this.createTime,
|
||||
});
|
||||
|
||||
factory OrderEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$OrderEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$OrderEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'order_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
OrderEntity _$OrderEntityFromJson(Map<String, dynamic> json) => OrderEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
uniqueCode: json['uniqueCode'] as String,
|
||||
serviceUniqueCode: json['serviceUniqueCode'] as String,
|
||||
sysType: $enumDecode(_$SysTypeEnumMap, json['sysType']),
|
||||
userCode: json['userCode'] as String,
|
||||
username: json['username'] as String?,
|
||||
hourType: json['hourType'] as String?,
|
||||
price: (json['price'] as num).toInt(),
|
||||
extraPrice: (json['extraPrice'] as num).toInt(),
|
||||
payPrice: (json['payPrice'] as num).toInt(),
|
||||
walletId: json['walletId'] as String?,
|
||||
orderSourceTypeId: json['orderSourceTypeId'] as String?,
|
||||
type: $enumDecode(_$OrderTypeEnumMap, json['type']),
|
||||
status: $enumDecode(_$OrderStatusEnumMap, json['status']),
|
||||
payType: $enumDecode(_$OrderPayTypeEnumMap, json['payType']),
|
||||
productDesc: json['productDesc'] as String?,
|
||||
count: (json['count'] as num).toInt(),
|
||||
weight: (json['weight'] as num).toDouble(),
|
||||
payTime: json['payTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['payTime'] as String),
|
||||
createTime: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OrderEntityToJson(OrderEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'uniqueCode': instance.uniqueCode,
|
||||
'serviceUniqueCode': instance.serviceUniqueCode,
|
||||
'sysType': _$SysTypeEnumMap[instance.sysType]!,
|
||||
'userCode': instance.userCode,
|
||||
'username': instance.username,
|
||||
'hourType': instance.hourType,
|
||||
'price': instance.price,
|
||||
'extraPrice': instance.extraPrice,
|
||||
'payPrice': instance.payPrice,
|
||||
'walletId': instance.walletId,
|
||||
'orderSourceTypeId': instance.orderSourceTypeId,
|
||||
'type': _$OrderTypeEnumMap[instance.type]!,
|
||||
'status': _$OrderStatusEnumMap[instance.status]!,
|
||||
'payType': _$OrderPayTypeEnumMap[instance.payType]!,
|
||||
'productDesc': instance.productDesc,
|
||||
'count': instance.count,
|
||||
'weight': instance.weight,
|
||||
'payTime': instance.payTime?.toIso8601String(),
|
||||
'createTime': instance.createTime.toIso8601String(),
|
||||
};
|
||||
|
||||
const _$SysTypeEnumMap = {
|
||||
SysType.supermarket: 'supermarket',
|
||||
SysType.canteen: 'canteen',
|
||||
};
|
||||
|
||||
const _$OrderTypeEnumMap = {
|
||||
OrderType.below: 'below',
|
||||
OrderType.reserve: 'reserve',
|
||||
OrderType.foreignTicket: 'foreignTicket',
|
||||
OrderType.strideDept: 'strideDept',
|
||||
};
|
||||
|
||||
const _$OrderStatusEnumMap = {
|
||||
OrderStatus.nonePay: 'nonePay',
|
||||
OrderStatus.pay: 'pay',
|
||||
OrderStatus.offlinePay: 'offlinePay',
|
||||
OrderStatus.refund: 'refund',
|
||||
};
|
||||
|
||||
const _$OrderPayTypeEnumMap = {
|
||||
OrderPayType.walletDefault: 'walletDefault',
|
||||
OrderPayType.walletQrCode: 'walletQrCode',
|
||||
OrderPayType.walletCard: 'walletCard',
|
||||
OrderPayType.face: 'face',
|
||||
OrderPayType.strideDeptQrCode: 'strideDeptQrCode',
|
||||
OrderPayType.foreignTicketQrCode: 'foreignTicketQrCode',
|
||||
OrderPayType.reserveQrCode: 'reserveQrCode',
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
part 'print_history_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "print_history")
|
||||
class PrintHistoryEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 对应的订单id
|
||||
String orderId;
|
||||
|
||||
/// 对应的服务端id
|
||||
String serviceOrderId;
|
||||
|
||||
/// 服务端的打印id
|
||||
String servicePrintId;
|
||||
|
||||
/// 发票图片地址
|
||||
String invoiceUrl;
|
||||
|
||||
/// 打印状态
|
||||
PrintStatus status;
|
||||
|
||||
/// 打印时间
|
||||
String? printTime;
|
||||
|
||||
/// 同步时间
|
||||
DateTime? syncTime;
|
||||
|
||||
/// 创建时间
|
||||
DateTime createTime;
|
||||
|
||||
PrintHistoryEntity({
|
||||
this.id,
|
||||
required this.orderId,
|
||||
required this.serviceOrderId,
|
||||
required this.servicePrintId,
|
||||
required this.invoiceUrl,
|
||||
required this.status,
|
||||
this.printTime,
|
||||
this.syncTime,
|
||||
required this.createTime,
|
||||
});
|
||||
|
||||
factory PrintHistoryEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$PrintHistoryEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PrintHistoryEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'print_history_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PrintHistoryEntity _$PrintHistoryEntityFromJson(Map<String, dynamic> json) =>
|
||||
PrintHistoryEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
orderId: json['orderId'] as String,
|
||||
serviceOrderId: json['serviceOrderId'] as String,
|
||||
servicePrintId: json['servicePrintId'] as String,
|
||||
invoiceUrl: json['invoiceUrl'] as String,
|
||||
status: $enumDecode(_$PrintStatusEnumMap, json['status']),
|
||||
printTime: json['printTime'] as String?,
|
||||
syncTime: json['syncTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['syncTime'] as String),
|
||||
createTime: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PrintHistoryEntityToJson(PrintHistoryEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'orderId': instance.orderId,
|
||||
'serviceOrderId': instance.serviceOrderId,
|
||||
'servicePrintId': instance.servicePrintId,
|
||||
'invoiceUrl': instance.invoiceUrl,
|
||||
'status': _$PrintStatusEnumMap[instance.status]!,
|
||||
'printTime': instance.printTime,
|
||||
'syncTime': instance.syncTime?.toIso8601String(),
|
||||
'createTime': instance.createTime.toIso8601String(),
|
||||
};
|
||||
|
||||
const _$PrintStatusEnumMap = {
|
||||
PrintStatus.none: 'none',
|
||||
PrintStatus.success: 'success',
|
||||
PrintStatus.sync: 'sync',
|
||||
PrintStatus.error: 'error',
|
||||
};
|
||||
@@ -0,0 +1,89 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/models/index.dart';
|
||||
|
||||
part 'product_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "product")
|
||||
class ProductEntity extends Equatable {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 服务端唯一标识
|
||||
String serviceUniqueCode;
|
||||
|
||||
/// 平台类型
|
||||
SysType sysType;
|
||||
|
||||
/// 分类 serviceID
|
||||
String classifyServiceUniqueCode;
|
||||
|
||||
/// 菜品时间类型
|
||||
ProductHourType? hourType;
|
||||
|
||||
/// 商品名
|
||||
String name;
|
||||
|
||||
/// 商品价格(分)
|
||||
int price;
|
||||
|
||||
/// 商品图片
|
||||
String? image;
|
||||
|
||||
/// 是否为默认
|
||||
bool isDefault;
|
||||
|
||||
/// 商品状态
|
||||
int status;
|
||||
|
||||
/// 排序 倒序排列
|
||||
int sort;
|
||||
|
||||
/// 创建时间
|
||||
DateTime createTime;
|
||||
|
||||
/// 同步时间
|
||||
DateTime updateTime;
|
||||
|
||||
/// 是否删除
|
||||
bool delFlag;
|
||||
|
||||
ProductEntity({
|
||||
this.id,
|
||||
required this.serviceUniqueCode,
|
||||
required this.sysType,
|
||||
required this.classifyServiceUniqueCode,
|
||||
required this.hourType,
|
||||
required this.name,
|
||||
required this.price,
|
||||
this.image,
|
||||
required this.isDefault,
|
||||
required this.status,
|
||||
required this.sort,
|
||||
required this.createTime,
|
||||
required this.updateTime,
|
||||
required this.delFlag,
|
||||
});
|
||||
|
||||
factory ProductEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ProductEntityToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
serviceUniqueCode,
|
||||
sysType,
|
||||
classifyServiceUniqueCode,
|
||||
hourType,
|
||||
name,
|
||||
price,
|
||||
image,
|
||||
status,
|
||||
sort,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'product_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ProductEntity _$ProductEntityFromJson(Map<String, dynamic> json) =>
|
||||
ProductEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
serviceUniqueCode: json['serviceUniqueCode'] as String,
|
||||
sysType: $enumDecode(_$SysTypeEnumMap, json['sysType']),
|
||||
classifyServiceUniqueCode: json['classifyServiceUniqueCode'] as String,
|
||||
hourType: $enumDecodeNullable(_$ProductHourTypeEnumMap, json['hourType']),
|
||||
name: json['name'] as String,
|
||||
price: (json['price'] as num).toInt(),
|
||||
image: json['image'] as String?,
|
||||
isDefault: json['isDefault'] as bool,
|
||||
status: (json['status'] as num).toInt(),
|
||||
sort: (json['sort'] as num).toInt(),
|
||||
createTime: DateTime.parse(json['createTime'] as String),
|
||||
updateTime: DateTime.parse(json['updateTime'] as String),
|
||||
delFlag: json['delFlag'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ProductEntityToJson(ProductEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'serviceUniqueCode': instance.serviceUniqueCode,
|
||||
'sysType': _$SysTypeEnumMap[instance.sysType]!,
|
||||
'classifyServiceUniqueCode': instance.classifyServiceUniqueCode,
|
||||
'hourType': _$ProductHourTypeEnumMap[instance.hourType],
|
||||
'name': instance.name,
|
||||
'price': instance.price,
|
||||
'image': instance.image,
|
||||
'isDefault': instance.isDefault,
|
||||
'status': instance.status,
|
||||
'sort': instance.sort,
|
||||
'createTime': instance.createTime.toIso8601String(),
|
||||
'updateTime': instance.updateTime.toIso8601String(),
|
||||
'delFlag': instance.delFlag,
|
||||
};
|
||||
|
||||
const _$SysTypeEnumMap = {
|
||||
SysType.supermarket: 'supermarket',
|
||||
SysType.canteen: 'canteen',
|
||||
};
|
||||
|
||||
const _$ProductHourTypeEnumMap = {
|
||||
ProductHourType.all: 'all',
|
||||
ProductHourType.morning: 'morning',
|
||||
ProductHourType.noon: 'noon',
|
||||
ProductHourType.night: 'night',
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'setting_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "setting")
|
||||
class SettingEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 用户信息
|
||||
String userJson;
|
||||
|
||||
/// 设备信息
|
||||
String sysJson;
|
||||
|
||||
/// 食堂额外金额信息
|
||||
String? canteenExtraPriceConfigJson;
|
||||
|
||||
SettingEntity({
|
||||
this.id,
|
||||
required this.userJson,
|
||||
required this.sysJson,
|
||||
this.canteenExtraPriceConfigJson,
|
||||
});
|
||||
|
||||
factory SettingEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$SettingEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SettingEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'setting_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SettingEntity _$SettingEntityFromJson(Map<String, dynamic> json) =>
|
||||
SettingEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
userJson: json['userJson'] as String,
|
||||
sysJson: json['sysJson'] as String,
|
||||
canteenExtraPriceConfigJson:
|
||||
json['canteenExtraPriceConfigJson'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SettingEntityToJson(SettingEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'userJson': instance.userJson,
|
||||
'sysJson': instance.sysJson,
|
||||
'canteenExtraPriceConfigJson': instance.canteenExtraPriceConfigJson,
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'shop_card_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "shop_card")
|
||||
class ShopCardEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 购物车的id字段
|
||||
int orderId;
|
||||
|
||||
/// 商品code
|
||||
String productServiceUniqueCode;
|
||||
|
||||
/// 商品名
|
||||
String productName;
|
||||
|
||||
/// 商品图片
|
||||
String productPic;
|
||||
|
||||
/// 商品价格(分)
|
||||
int productPrice;
|
||||
|
||||
/// 数量 食堂特有
|
||||
int productNumber;
|
||||
|
||||
/// 重量 超市特有
|
||||
double productWidget;
|
||||
|
||||
/// 单商品总价(分)
|
||||
int totalPrice;
|
||||
|
||||
ShopCardEntity({
|
||||
this.id,
|
||||
required this.orderId,
|
||||
required this.productServiceUniqueCode,
|
||||
required this.productName,
|
||||
required this.productPic,
|
||||
required this.productPrice,
|
||||
required this.productNumber,
|
||||
required this.productWidget,
|
||||
required this.totalPrice,
|
||||
});
|
||||
|
||||
factory ShopCardEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ShopCardEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ShopCardEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'shop_card_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ShopCardEntity _$ShopCardEntityFromJson(Map<String, dynamic> json) =>
|
||||
ShopCardEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
orderId: (json['orderId'] as num).toInt(),
|
||||
productServiceUniqueCode: json['productServiceUniqueCode'] as String,
|
||||
productName: json['productName'] as String,
|
||||
productPic: json['productPic'] as String,
|
||||
productPrice: (json['productPrice'] as num).toInt(),
|
||||
productNumber: (json['productNumber'] as num).toInt(),
|
||||
productWidget: (json['productWidget'] as num).toDouble(),
|
||||
totalPrice: (json['totalPrice'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ShopCardEntityToJson(ShopCardEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'orderId': instance.orderId,
|
||||
'productServiceUniqueCode': instance.productServiceUniqueCode,
|
||||
'productName': instance.productName,
|
||||
'productPic': instance.productPic,
|
||||
'productPrice': instance.productPrice,
|
||||
'productNumber': instance.productNumber,
|
||||
'productWidget': instance.productWidget,
|
||||
'totalPrice': instance.totalPrice,
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Entity(tableName: "user_record")
|
||||
class UserEntity {
|
||||
/// 自增ID
|
||||
@PrimaryKey(autoGenerate: true)
|
||||
int? id;
|
||||
|
||||
/// 用户id
|
||||
String userId;
|
||||
|
||||
/// 用户名
|
||||
String nickname;
|
||||
|
||||
/// 手机号码
|
||||
String? mobile;
|
||||
|
||||
/// 用户头像
|
||||
String? avatar;
|
||||
|
||||
/// 钱包卡号
|
||||
String? walletCardNumber;
|
||||
|
||||
/// 钱包id
|
||||
String? walletId;
|
||||
|
||||
/// 钱包类型id
|
||||
String? walletTypeId;
|
||||
|
||||
/// 钱包余额
|
||||
int? walletBalance;
|
||||
|
||||
/// 创建时间
|
||||
DateTime? createTime;
|
||||
|
||||
/// 同步时间
|
||||
DateTime? updateTime;
|
||||
|
||||
UserEntity({
|
||||
this.id,
|
||||
required this.userId,
|
||||
required this.nickname,
|
||||
this.mobile,
|
||||
this.avatar,
|
||||
this.walletCardNumber,
|
||||
this.walletId,
|
||||
this.walletTypeId,
|
||||
this.walletBalance,
|
||||
this.createTime,
|
||||
this.updateTime,
|
||||
});
|
||||
|
||||
factory UserEntity.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserEntityFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$UserEntityToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
UserEntity _$UserEntityFromJson(Map<String, dynamic> json) => UserEntity(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
userId: json['userId'] as String,
|
||||
nickname: json['nickname'] as String,
|
||||
mobile: json['mobile'] as String?,
|
||||
avatar: json['avatar'] as String?,
|
||||
walletCardNumber: json['walletCardNumber'] as String?,
|
||||
walletId: json['walletId'] as String?,
|
||||
walletTypeId: json['walletTypeId'] as String?,
|
||||
walletBalance: (json['walletBalance'] as num?)?.toInt(),
|
||||
createTime: json['createTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createTime'] as String),
|
||||
updateTime: json['updateTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updateTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserEntityToJson(UserEntity instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'userId': instance.userId,
|
||||
'nickname': instance.nickname,
|
||||
'mobile': instance.mobile,
|
||||
'avatar': instance.avatar,
|
||||
'walletCardNumber': instance.walletCardNumber,
|
||||
'walletId': instance.walletId,
|
||||
'walletTypeId': instance.walletTypeId,
|
||||
'walletBalance': instance.walletBalance,
|
||||
'createTime': instance.createTime?.toIso8601String(),
|
||||
'updateTime': instance.updateTime?.toIso8601String(),
|
||||
};
|
||||
Reference in new issue
Block a user