123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- import 'liveConsultation.m.dart';
- import 'education.m.dart';
- import 'notification.m.dart';
- import 'package:fis_jsonrpc/utils.dart';
- class CreateOrderResultDTO {
- String? orderCode;
- CreateOrderResultDTO({
- this.orderCode,
- });
- factory CreateOrderResultDTO.fromJson(Map<String, dynamic> map) {
- return CreateOrderResultDTO(
- orderCode: map['OrderCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (orderCode != null) {
- map['OrderCode'] = orderCode;
- }
- return map;
- }
- }
- enum OrderTypeEnum {
- General,
- }
- class CreateOrderRequest extends TokenRequest{
- String? orderUserCode;
- String? productCode;
- String? tPORderCode;
- String? orderTitle;
- OrderTypeEnum orderType;
- double orderAmount;
- DateTime? payTime;
- PayStatusEnum payStatus;
- CreateOrderRequest({
- this.orderUserCode,
- this.productCode,
- this.tPORderCode,
- this.orderTitle,
- this.orderType = OrderTypeEnum.General,
- this.orderAmount = 0,
- this.payTime,
- this.payStatus = PayStatusEnum.NoPay,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateOrderRequest.fromJson(Map<String, dynamic> map) {
- return CreateOrderRequest(
- orderUserCode: map['OrderUserCode'],
- productCode: map['ProductCode'],
- tPORderCode: map['TPORderCode'],
- orderTitle: map['OrderTitle'],
- orderType: OrderTypeEnum.values.firstWhere((e) => e.index == map['OrderType']),
- orderAmount: double.parse(map['OrderAmount'].toString()),
- payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
- payStatus: PayStatusEnum.values.firstWhere((e) => e.index == map['PayStatus']),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (orderUserCode != null)
- map['OrderUserCode'] = orderUserCode;
- if (productCode != null)
- map['ProductCode'] = productCode;
- if (tPORderCode != null)
- map['TPORderCode'] = tPORderCode;
- if (orderTitle != null)
- map['OrderTitle'] = orderTitle;
- map['OrderType'] = orderType.index;
- map['OrderAmount'] = orderAmount;
- if (payTime != null)
- map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
- map['PayStatus'] = payStatus.index;
- return map;
- }
- }
- class OrderDetailDTO extends BaseDTO{
- String? code;
- String? orderUserName;
- String? orderUserCode;
- String? productCode;
- String? tPORderCode;
- String? orderTitle;
- OrderTypeEnum orderType;
- double orderAmount;
- DateTime? payTime;
- PayStatusEnum payStatus;
- OrderDetailDTO({
- this.code,
- this.orderUserName,
- this.orderUserCode,
- this.productCode,
- this.tPORderCode,
- this.orderTitle,
- this.orderType = OrderTypeEnum.General,
- this.orderAmount = 0,
- this.payTime,
- this.payStatus = PayStatusEnum.NoPay,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrderDetailDTO.fromJson(Map<String, dynamic> map) {
- return OrderDetailDTO(
- code: map['Code'],
- orderUserName: map['OrderUserName'],
- orderUserCode: map['OrderUserCode'],
- productCode: map['ProductCode'],
- tPORderCode: map['TPORderCode'],
- orderTitle: map['OrderTitle'],
- orderType: OrderTypeEnum.values.firstWhere((e) => e.index == map['OrderType']),
- orderAmount: double.parse(map['OrderAmount'].toString()),
- payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
- payStatus: PayStatusEnum.values.firstWhere((e) => e.index == map['PayStatus']),
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (orderUserName != null)
- map['OrderUserName'] = orderUserName;
- if (orderUserCode != null)
- map['OrderUserCode'] = orderUserCode;
- if (productCode != null)
- map['ProductCode'] = productCode;
- if (tPORderCode != null)
- map['TPORderCode'] = tPORderCode;
- if (orderTitle != null)
- map['OrderTitle'] = orderTitle;
- map['OrderType'] = orderType.index;
- map['OrderAmount'] = orderAmount;
- if (payTime != null)
- map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
- map['PayStatus'] = payStatus.index;
- return map;
- }
- }
- class GetOrderDetailRequest extends TokenRequest{
- String? orderCode;
- GetOrderDetailRequest({
- this.orderCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetOrderDetailRequest.fromJson(Map<String, dynamic> map) {
- return GetOrderDetailRequest(
- orderCode: map['OrderCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (orderCode != null)
- map['OrderCode'] = orderCode;
- return map;
- }
- }
- class GetOrderPagesRequest extends PageRequest{
- String? keyWord;
- GetOrderPagesRequest({
- this.keyWord,
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory GetOrderPagesRequest.fromJson(Map<String, dynamic> map) {
- return GetOrderPagesRequest(
- keyWord: map['KeyWord'],
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (keyWord != null)
- map['KeyWord'] = keyWord;
- return map;
- }
- }
- class PayInfoDTO {
- bool isSuccess;
- String? payUrl;
- PayInfoDTO({
- this.isSuccess = false,
- this.payUrl,
- });
- factory PayInfoDTO.fromJson(Map<String, dynamic> map) {
- return PayInfoDTO(
- isSuccess: map['IsSuccess'],
- payUrl: map['PayUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['IsSuccess'] = isSuccess;
- if (payUrl != null) {
- map['PayUrl'] = payUrl;
- }
- return map;
- }
- }
- class GoToPayRequest extends TokenRequest{
- PayTypeEnum payType;
- String? orderCode;
- GoToPayRequest({
- this.payType = PayTypeEnum.Alipay_PAGE,
- this.orderCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GoToPayRequest.fromJson(Map<String, dynamic> map) {
- return GoToPayRequest(
- payType: PayTypeEnum.values.firstWhere((e) => e.index == map['PayType']),
- orderCode: map['OrderCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['PayType'] = payType.index;
- if (orderCode != null)
- map['OrderCode'] = orderCode;
- return map;
- }
- }
- class PayCallbackDTO extends BaseDTO{
- bool isSuccess;
- PayCallbackDTO({
- this.isSuccess = false,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory PayCallbackDTO.fromJson(Map<String, dynamic> map) {
- return PayCallbackDTO(
- isSuccess: map['IsSuccess'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['IsSuccess'] = isSuccess;
- return map;
- }
- }
- class PayableTypeDTO {
- List<String>? payTypes;
- PayableTypeDTO({
- this.payTypes,
- });
- factory PayableTypeDTO.fromJson(Map<String, dynamic> map) {
- return PayableTypeDTO(
- payTypes: map['PayTypes']?.cast<String>().toList(),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (payTypes != null) {
- map['PayTypes'] = payTypes;
- }
- return map;
- }
- }
|