Files
biz_xfj_cloud/lib/common/models/api/hard_api_models.dart
T

582 lines
12 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
part 'hard_api_models.g.dart';
@JsonSerializable()
class ServiceHardware extends ServiceBase {
/// 编号
final String? id;
/// 设备名
final String? name;
/// 设备类型
final String? type;
/// 设备类型enum
final String? typeEnum;
/// 商户id
final String? merchantId;
/// 商户部门id
final String? merchantDeptId;
/// 硬件分组id
final String? hardGroupId;
/// 商户名
final String? merchantStr;
/// mq连接id
final String? mqClientId;
/// android唯一id
final String? uniqueCode;
/// 当前设备的topic
final String? mainTopic;
/// mq地址
final String? mqSocketAddress;
/// mq端口
final String? mqSocketPort;
/// mq用户名
final String? mqUsername;
/// mq密码
final String? mqPassword;
/// 同步次数版本
final int? mqSyncCount;
/// 人脸appId
final String? faceAppId;
/// 人脸sdkKey
final String? faceSdkKey;
/// 人脸activeKey
final String? faceActiveKey;
ServiceHardware({
this.id,
this.name,
this.type,
this.typeEnum,
this.merchantId,
this.merchantDeptId,
this.hardGroupId,
this.merchantStr,
this.mqClientId,
this.uniqueCode,
this.mainTopic,
this.mqSocketAddress,
this.mqSocketPort,
this.mqUsername,
this.mqPassword,
this.mqSyncCount,
this.faceAppId,
this.faceSdkKey,
this.faceActiveKey,
});
factory ServiceHardware.fromJson(Map<String, dynamic> json) =>
_$ServiceHardwareFromJson(json);
@override
Map<String, dynamic> toJson() => _$ServiceHardwareToJson(this);
}
@JsonSerializable()
class ServiceCar {
/// 编号
final String? id;
/// 父购物车id
final String? parentCarId;
/// 商品名
final String? productName;
/// 商品价格
final int? productPrice;
/// 商品id
final String? productId;
/// 数量
final int? productCount;
/// 总价(分)
@JsonKey(fromJson: JsonTool.stringToInt, toJson: JsonTool.intToString)
final int? totalPrice;
/// 商品图片
final String? productPic;
ServiceCar({
this.id,
this.parentCarId,
this.productName,
this.productPrice,
this.productId,
this.productCount,
this.totalPrice,
this.productPic,
});
factory ServiceCar.fromJson(Map<String, dynamic> json) =>
_$ServiceCarFromJson(json);
Map<String, dynamic> toJson() => _$ServiceCarToJson(this);
}
@JsonSerializable()
class ServiceGenerateInvoice {
/// 图片
final String? pic;
/// 记录id
final String? historyId;
ServiceGenerateInvoice({
this.pic,
this.historyId,
});
factory ServiceGenerateInvoice.fromJson(Map<String, dynamic> json) =>
_$ServiceGenerateInvoiceFromJson(json);
Map<String, dynamic> toJson() => _$ServiceGenerateInvoiceToJson(this);
}
@JsonSerializable()
class ServiceQRCode {
/// 总id
@JsonKey(fromJson: JsonTool.intToString, toJson: JsonTool.stringToInt)
final String? id;
/// 子id
@JsonKey(fromJson: JsonTool.intToString, toJson: JsonTool.stringToInt)
final String? itemId;
/// 类型id 比如钱包类型
@JsonKey(fromJson: JsonTool.intToString, toJson: JsonTool.stringToInt)
final String? typeId;
/// 用户id
@JsonKey(fromJson: JsonTool.intToString, toJson: JsonTool.stringToInt)
final String? userId;
/// 订单类型
@JsonKey(
fromJson: JsonTool.stringToOrderType,
toJson: JsonTool.orderTypeToString,
)
final OrderType? orderType;
/// 支付类型
@JsonKey(
fromJson: JsonTool.stringToOrderPayType,
toJson: JsonTool.orderPayTypeToString,
)
final OrderPayType? payType;
/// 过期时间 -1 代表没有限制
final int? exceedTime;
/// 额外的用户信息
final String? extra;
ServiceQRCode({
this.id,
this.itemId,
this.typeId,
this.userId,
this.orderType,
this.payType,
this.exceedTime,
this.extra,
});
factory ServiceQRCode.fromJson(Map<String, dynamic> json) =>
_$ServiceQRCodeFromJson(json);
Map<String, dynamic> toJson() => _$ServiceQRCodeToJson(this);
}
@JsonSerializable()
class ServiceHardOrder {
/// 用户id
final String? userId;
/// 用户名
final String? username;
/// 用户手机号
final String? userMobile;
/// 用户头像
final String? userAvatar;
/// 订单类型
final String? orderType;
/// 订单状态
final String? orderStatus;
/// 支付方式
final String? payType;
/// 支付方式
final String? walletId;
ServiceHardOrder({
this.userId,
this.username,
this.userMobile,
this.userAvatar,
this.orderType,
this.orderStatus,
this.payType,
this.walletId,
});
factory ServiceHardOrder.fromJson(Map<String, dynamic> json) =>
_$ServiceHardOrderFromJson(json);
Map<String, dynamic> toJson() => _$ServiceHardOrderToJson(this);
}
@JsonSerializable()
class ServiceOpenCard {
/// 用户名
String? username;
/// 用户手机号
String? mobile;
/// 用户头像
String? avatar;
/// 饭卡状态
String? cardStatus;
/// 编号
String? id;
/// 部门名
String? deptId;
/// 部门名
String? deptName;
/// 用户编号
String? userId;
/// 饭卡类型Id
String? walletTypeId;
/// 饭卡类型
String? walletTypeUniqueCode;
/// 饭卡图标
String? walletTypeIcon;
/// 用户卡号
String? cardNumber;
/// 钱包编号
String? walletId;
/// 是否激活
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
bool? isActiveHardware;
ServiceOpenCard({
this.username,
this.mobile,
this.avatar,
this.cardStatus,
this.id,
this.deptId,
this.deptName,
this.userId,
this.walletTypeId,
this.walletTypeUniqueCode,
this.walletTypeIcon,
this.cardNumber,
this.walletId,
this.isActiveHardware,
});
factory ServiceOpenCard.fromJson(Map<String, dynamic> json) =>
_$ServiceOpenCardFromJson(json);
Map<String, dynamic> toJson() => _$ServiceOpenCardToJson(this);
}
@JsonSerializable()
class ServiceOpenCardPage extends ServicePageBase {
List<ServiceOpenCard>? records;
ServiceOpenCardPage({
this.records,
});
factory ServiceOpenCardPage.fromJson(Map<String, dynamic> json) =>
_$ServiceOpenCardPageFromJson(
json,
);
Map<String, dynamic> toJson() => _$ServiceOpenCardPageToJson(this);
}
@JsonSerializable()
class ServiceChartLatitude {
/// 早餐、中餐、晚餐
final List<ServiceChartLatitudeItem> dayTotal;
/// 每天的交易量
final List<ServiceChartLatitudeItem> weekTotal;
/// 每天的交易金额
final List<ServiceChartLatitudeItem> monthTotal;
/// 每周的交易量
final List<ServiceChartLatitudeItem> yearTotal;
/// 每周的交易量
final List<ServiceChartLatitudeItem> allTotal;
ServiceChartLatitude({
required this.dayTotal,
required this.weekTotal,
required this.monthTotal,
required this.yearTotal,
required this.allTotal,
});
factory ServiceChartLatitude.fromJson(Map<String, dynamic> json) =>
_$ServiceChartLatitudeFromJson(
json,
);
Map<String, dynamic> toJson() => _$ServiceChartLatitudeToJson(this);
}
@JsonSerializable()
class ServiceChartLatitudeItem {
/// 早餐、中餐、晚餐
final String? hourType;
/// 每月的交易量
final String? deptId;
/// 每月的交易量
final String? sum;
/// 每月的交易量
final String? count;
ServiceChartLatitudeItem({
this.hourType,
this.deptId,
this.sum,
this.count,
});
factory ServiceChartLatitudeItem.fromJson(Map<String, dynamic> json) =>
_$ServiceChartLatitudeItemFromJson(
json,
);
Map<String, dynamic> toJson() => _$ServiceChartLatitudeItemToJson(this);
}
@JsonSerializable()
class ServiceBroadcastToday {
/// 广播id
final String id;
/// 预定用户
final String userId;
/// 用户名
final String username;
/// 用户手机号
final String userMobile;
/// 硬件id
final String hardId;
/// mq主题
final String topic;
/// 业务类型
final String? bizType;
/// 关联业务编号
final String? bizId;
/// 预定标题
final String title;
/// 预定内容
final String content;
/// 当前广播次数
final int? broadcastCount;
/// 最大广播次数
final int? broadcastMaxCount;
/// 是否广播语音
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
final bool isBroadcast;
/// 用餐时间段
final String? hourType;
/// 商品介绍
String productDesc;
/// 支付价格
int payPrice;
/// 创建时间
String createTime;
ServiceBroadcastToday({
required this.id,
required this.userId,
required this.username,
required this.userMobile,
required this.hardId,
required this.topic,
this.bizType,
this.bizId,
required this.title,
required this.content,
this.broadcastCount,
this.broadcastMaxCount,
required this.isBroadcast,
this.hourType,
required this.productDesc,
required this.payPrice,
required this.createTime,
});
factory ServiceBroadcastToday.fromJson(Map<String, dynamic> json) =>
_$ServiceBroadcastTodayFromJson(
json,
);
Map<String, dynamic> toJson() => _$ServiceBroadcastTodayToJson(this);
}
@JsonSerializable()
class ServiceBroadcastTodayPage extends ServicePageBase {
List<ServiceBroadcastToday>? records;
ServiceBroadcastTodayPage({
this.records,
});
factory ServiceBroadcastTodayPage.fromJson(Map<String, dynamic> json) =>
_$ServiceBroadcastTodayPageFromJson(
json,
);
Map<String, dynamic> toJson() => _$ServiceBroadcastTodayPageToJson(this);
}
@JsonSerializable()
class ServiceHardCreateHardQrCodeScanOrder {
/// 订单id
String orderId;
/// 订单id
String mchId;
/// 订单id
String qrCodeData;
ServiceHardCreateHardQrCodeScanOrder({
required this.orderId,
required this.mchId,
required this.qrCodeData,
});
factory ServiceHardCreateHardQrCodeScanOrder.fromJson(
Map<String, dynamic> json) =>
_$ServiceHardCreateHardQrCodeScanOrderFromJson(
json,
);
Map<String, dynamic> toJson() =>
_$ServiceHardCreateHardQrCodeScanOrderToJson(this);
}
/// 终端识别本人后返回的预约菜单,身份字段已经由服务端脱敏。
@JsonSerializable(explicitToJson: true)
class ServiceReservationMenuQuery {
final String maskedName;
final String? deptName;
final String merchantName;
final int totalDayCount;
final int totalMealCount;
final List<ServiceReservationDay> days;
const ServiceReservationMenuQuery({
required this.maskedName,
this.deptName,
required this.merchantName,
required this.totalDayCount,
required this.totalMealCount,
required this.days,
});
factory ServiceReservationMenuQuery.fromJson(Map<String, dynamic> json) =>
_$ServiceReservationMenuQueryFromJson(json);
Map<String, dynamic> toJson() => _$ServiceReservationMenuQueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ServiceReservationDay {
final String date;
final List<ServiceReservationMeal> meals;
const ServiceReservationDay({
required this.date,
required this.meals,
});
factory ServiceReservationDay.fromJson(Map<String, dynamic> json) =>
_$ServiceReservationDayFromJson(json);
Map<String, dynamic> toJson() => _$ServiceReservationDayToJson(this);
}
@JsonSerializable()
class ServiceReservationMeal {
final String hourType;
final String mealTitle;
final List<String> items;
const ServiceReservationMeal({
required this.hourType,
required this.mealTitle,
required this.items,
});
factory ServiceReservationMeal.fromJson(Map<String, dynamic> json) =>
_$ServiceReservationMealFromJson(json);
Map<String, dynamic> toJson() => _$ServiceReservationMealToJson(this);
}