parent
4f4b3b145d
commit
5905d35f5c
@ -0,0 +1,31 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'key_manage_record_list_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class KeyManageRecordListModel {
|
||||
int id;
|
||||
String code;
|
||||
int status;
|
||||
String? facilityName;
|
||||
String? correspondingPosition;
|
||||
String? storageLocation;
|
||||
String? auditDate;
|
||||
String? reason;
|
||||
factory KeyManageRecordListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$KeyManageRecordListModelFromJson(json);
|
||||
String get auditDateString =>
|
||||
DateUtil.formatDateStr(auditDate ?? '', format: 'yyyy-MM-dd HH:mm');
|
||||
|
||||
KeyManageRecordListModel({
|
||||
required this.id,
|
||||
required this.code,
|
||||
required this.status,
|
||||
this.facilityName,
|
||||
this.correspondingPosition,
|
||||
this.storageLocation,
|
||||
this.auditDate,
|
||||
this.reason,
|
||||
});
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'key_manage_record_list_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
KeyManageRecordListModel _$KeyManageRecordListModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return KeyManageRecordListModel(
|
||||
id: json['id'] as int,
|
||||
code: json['code'] as String,
|
||||
status: json['status'] as int,
|
||||
facilityName: json['facilityName'] as String?,
|
||||
correspondingPosition: json['correspondingPosition'] as String?,
|
||||
storageLocation: json['storageLocation'] as String?,
|
||||
auditDate: json['auditDate'] as String?,
|
||||
reason: json['reason'] as String?,
|
||||
);
|
||||
}
|
@ -1,48 +1,47 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
class KeyManageRecordListModel {
|
||||
int? id;
|
||||
String? code;
|
||||
int? status;
|
||||
String? facilityName;
|
||||
String? correspondingPosition;
|
||||
String? storageLocation;
|
||||
String? auditDate;
|
||||
String? reason;
|
||||
|
||||
KeyManageRecordListModel(
|
||||
{required this.id,
|
||||
this.code,
|
||||
this.status,
|
||||
this.facilityName,
|
||||
this.correspondingPosition,
|
||||
this.storageLocation,
|
||||
this.auditDate,
|
||||
this.reason});
|
||||
|
||||
KeyManageRecordListModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
code = json['code'];
|
||||
status = json['status'];
|
||||
facilityName = json['facilityName'];
|
||||
correspondingPosition = json['correspondingPosition'];
|
||||
storageLocation = json['storageLocation'];
|
||||
auditDate = json['auditDate'];
|
||||
reason = json['reason'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['code'] = this.code;
|
||||
data['status'] = this.status;
|
||||
data['facilityName'] = this.facilityName;
|
||||
data['correspondingPosition'] = this.correspondingPosition;
|
||||
data['storageLocation'] = this.storageLocation;
|
||||
data['auditDate'] = this.auditDate;
|
||||
data['reason'] = this.reason;
|
||||
return data;
|
||||
}
|
||||
|
||||
String get auditDateString => DateUtil.formatDateStr(this.auditDate!,format: 'yyyy-MM-dd HH:mm');
|
||||
}
|
||||
// import 'package:common_utils/common_utils.dart';
|
||||
//
|
||||
// class KeyManageRecordListModel {
|
||||
// int? id;
|
||||
// String? code;
|
||||
// int? status;
|
||||
// String? facilityName;
|
||||
// String? correspondingPosition;
|
||||
// String? storageLocation;
|
||||
// String? auditDate;
|
||||
// String? reason;
|
||||
//
|
||||
// KeyManageRecordListModel(
|
||||
// {required this.id,
|
||||
// this.code,
|
||||
// this.status,
|
||||
// this.facilityName,
|
||||
// this.correspondingPosition,
|
||||
// this.storageLocation,
|
||||
// this.auditDate,
|
||||
// this.reason});
|
||||
//
|
||||
// KeyManageRecordListModel.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// code = json['code'];
|
||||
// status = json['status'];
|
||||
// facilityName = json['facilityName'];
|
||||
// correspondingPosition = json['correspondingPosition'];
|
||||
// storageLocation = json['storageLocation'];
|
||||
// auditDate = json['auditDate'];
|
||||
// reason = json['reason'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['id'] = this.id;
|
||||
// data['code'] = this.code;
|
||||
// data['status'] = this.status;
|
||||
// data['facilityName'] = this.facilityName;
|
||||
// data['correspondingPosition'] = this.correspondingPosition;
|
||||
// data['storageLocation'] = this.storageLocation;
|
||||
// data['auditDate'] = this.auditDate;
|
||||
// data['reason'] = this.reason;
|
||||
// return data;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
Loading…
Reference in new issue