build to cache
This commit is contained in:
parent
d07ded57c4
commit
19c87d7f2b
34 changed files with 645 additions and 692 deletions
|
@ -4,7 +4,7 @@ builders:
|
|||
builder_factories:
|
||||
- ormBuilder
|
||||
auto_apply: root_package
|
||||
build_to: source
|
||||
build_to: cache
|
||||
build_extensions:
|
||||
.dart:
|
||||
- ".angel_orm.g.part"
|
||||
|
|
|
@ -3,11 +3,8 @@ library angel_orm.generator.models.author;
|
|||
import 'package:angel_model/angel_model.dart';
|
||||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
|
||||
part 'author.g.dart';
|
||||
|
||||
part 'author.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
class _Author extends Model {
|
||||
|
|
|
@ -139,3 +139,54 @@ class Author extends _Author {
|
|||
return AuthorSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class AuthorSerializer {
|
||||
static Author fromMap(Map map) {
|
||||
return new Author(
|
||||
id: map['id'] as String,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Author model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AuthorFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm.generator.models.author;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class AuthorSerializer {
|
||||
static Author fromMap(Map map) {
|
||||
return new Author(
|
||||
id: map['id'] as String,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Author model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AuthorFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -5,7 +5,6 @@ import 'package:angel_orm/angel_orm.dart';
|
|||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
import 'author.dart';
|
||||
part 'book.g.dart';
|
||||
part 'book.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -214,3 +214,68 @@ class Book extends _Book {
|
|||
return BookSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class BookSerializer {
|
||||
static Book fromMap(Map map) {
|
||||
return new Book(
|
||||
id: map['id'] as String,
|
||||
author: map['author'] != null
|
||||
? AuthorSerializer.fromMap(map['author'] as Map)
|
||||
: null,
|
||||
partnerAuthor: map['partner_author'] != null
|
||||
? AuthorSerializer.fromMap(map['partner_author'] as Map)
|
||||
: null,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Book model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'author': AuthorSerializer.toMap(model.author),
|
||||
'partner_author': AuthorSerializer.toMap(model.partnerAuthor),
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BookFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
author,
|
||||
partnerAuthor,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String author = 'author';
|
||||
|
||||
static const String partnerAuthor = 'partner_author';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm.generator.models.book;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class BookSerializer {
|
||||
static Book fromMap(Map map) {
|
||||
return new Book(
|
||||
id: map['id'] as String,
|
||||
author: map['author'] != null
|
||||
? AuthorSerializer.fromMap(map['author'] as Map)
|
||||
: null,
|
||||
partnerAuthor: map['partner_author'] != null
|
||||
? AuthorSerializer.fromMap(map['partner_author'] as Map)
|
||||
: null,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Book model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'author': AuthorSerializer.toMap(model.author),
|
||||
'partner_author': AuthorSerializer.toMap(model.partnerAuthor),
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BookFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
author,
|
||||
partnerAuthor,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String author = 'author';
|
||||
|
||||
static const String partnerAuthor = 'partner_author';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -4,7 +4,6 @@ import 'package:angel_model/angel_model.dart';
|
|||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'car.g.dart';
|
||||
part 'car.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -221,3 +221,73 @@ class Car extends _Car {
|
|||
return CarSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class CarSerializer {
|
||||
static Car fromMap(Map map) {
|
||||
return new Car(
|
||||
id: map['id'] as String,
|
||||
make: map['make'] as String,
|
||||
description: map['description'] as String,
|
||||
familyFriendly: map['family_friendly'] as bool,
|
||||
recalledAt: map['recalled_at'] != null
|
||||
? (map['recalled_at'] is DateTime
|
||||
? (map['recalled_at'] as DateTime)
|
||||
: DateTime.parse(map['recalled_at'].toString()))
|
||||
: null,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Car model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'make': model.make,
|
||||
'description': model.description,
|
||||
'family_friendly': model.familyFriendly,
|
||||
'recalled_at': model.recalledAt?.toIso8601String(),
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CarFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
make,
|
||||
description,
|
||||
familyFriendly,
|
||||
recalledAt,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String make = 'make';
|
||||
|
||||
static const String description = 'description';
|
||||
|
||||
static const String familyFriendly = 'family_friendly';
|
||||
|
||||
static const String recalledAt = 'recalled_at';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm.generator.models.car;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class CarSerializer {
|
||||
static Car fromMap(Map map) {
|
||||
return new Car(
|
||||
id: map['id'] as String,
|
||||
make: map['make'] as String,
|
||||
description: map['description'] as String,
|
||||
familyFriendly: map['family_friendly'] as bool,
|
||||
recalledAt: map['recalled_at'] != null
|
||||
? (map['recalled_at'] is DateTime
|
||||
? (map['recalled_at'] as DateTime)
|
||||
: DateTime.parse(map['recalled_at'].toString()))
|
||||
: null,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Car model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'make': model.make,
|
||||
'description': model.description,
|
||||
'family_friendly': model.familyFriendly,
|
||||
'recalled_at': model.recalledAt?.toIso8601String(),
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CarFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
make,
|
||||
description,
|
||||
familyFriendly,
|
||||
recalledAt,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String make = 'make';
|
||||
|
||||
static const String description = 'description';
|
||||
|
||||
static const String familyFriendly = 'family_friendly';
|
||||
|
||||
static const String recalledAt = 'recalled_at';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -4,7 +4,6 @@ import 'package:angel_model/angel_model.dart';
|
|||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'customer.g.dart';
|
||||
part 'customer.serializer.g.dart';
|
||||
|
||||
@orm
|
||||
@serializable
|
||||
|
|
|
@ -121,3 +121,49 @@ class Customer extends _Customer {
|
|||
return CustomerSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class CustomerSerializer {
|
||||
static Customer fromMap(Map map) {
|
||||
return new Customer(
|
||||
id: map['id'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Customer model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CustomerFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.customer;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class CustomerSerializer {
|
||||
static Customer fromMap(Map map) {
|
||||
return new Customer(
|
||||
id: map['id'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Customer model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CustomerFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -4,7 +4,6 @@ import 'package:angel_model/angel_model.dart';
|
|||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'foot.g.dart';
|
||||
part 'foot.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@Orm(tableName: 'feet')
|
||||
|
|
|
@ -158,3 +158,59 @@ class Foot extends _Foot {
|
|||
return FootSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class FootSerializer {
|
||||
static Foot fromMap(Map map) {
|
||||
return new Foot(
|
||||
id: map['id'] as String,
|
||||
legId: map['leg_id'] as int,
|
||||
nToes: map['n_toes'] as int,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Foot model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'leg_id': model.legId,
|
||||
'n_toes': model.nToes,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FootFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
legId,
|
||||
nToes,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String legId = 'leg_id';
|
||||
|
||||
static const String nToes = 'n_toes';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.foot;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class FootSerializer {
|
||||
static Foot fromMap(Map map) {
|
||||
return new Foot(
|
||||
id: map['id'] as String,
|
||||
legId: map['leg_id'] as int,
|
||||
nToes: map['n_toes'] as int,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Foot model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'leg_id': model.legId,
|
||||
'n_toes': model.nToes,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FootFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
legId,
|
||||
nToes,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String legId = 'leg_id';
|
||||
|
||||
static const String nToes = 'n_toes';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -4,7 +4,6 @@ import 'package:angel_model/angel_model.dart';
|
|||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'fruit.g.dart';
|
||||
part 'fruit.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -159,3 +159,59 @@ class Fruit extends _Fruit {
|
|||
return FruitSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class FruitSerializer {
|
||||
static Fruit fromMap(Map map) {
|
||||
return new Fruit(
|
||||
id: map['id'] as String,
|
||||
treeId: map['tree_id'] as int,
|
||||
commonName: map['common_name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Fruit model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'tree_id': model.treeId,
|
||||
'common_name': model.commonName,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FruitFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
treeId,
|
||||
commonName,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String treeId = 'tree_id';
|
||||
|
||||
static const String commonName = 'common_name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.fruit;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class FruitSerializer {
|
||||
static Fruit fromMap(Map map) {
|
||||
return new Fruit(
|
||||
id: map['id'] as String,
|
||||
treeId: map['tree_id'] as int,
|
||||
commonName: map['common_name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Fruit model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'tree_id': model.treeId,
|
||||
'common_name': model.commonName,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FruitFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
treeId,
|
||||
commonName,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String treeId = 'tree_id';
|
||||
|
||||
static const String commonName = 'common_name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -5,7 +5,6 @@ import 'package:angel_orm/angel_orm.dart';
|
|||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
import 'foot.dart';
|
||||
part 'leg.g.dart';
|
||||
part 'leg.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -170,3 +170,61 @@ class Leg extends _Leg {
|
|||
return LegSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class LegSerializer {
|
||||
static Leg fromMap(Map map) {
|
||||
return new Leg(
|
||||
id: map['id'] as String,
|
||||
foot: map['foot'] != null
|
||||
? FootSerializer.fromMap(map['foot'] as Map)
|
||||
: null,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Leg model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'foot': FootSerializer.toMap(model.foot),
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class LegFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
foot,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String foot = 'foot';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.leg;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class LegSerializer {
|
||||
static Leg fromMap(Map map) {
|
||||
return new Leg(
|
||||
id: map['id'] as String,
|
||||
foot: map['foot'] != null
|
||||
? FootSerializer.fromMap(map['foot'] as Map)
|
||||
: null,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Leg model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'foot': FootSerializer.toMap(model.foot),
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class LegFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
foot,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String foot = 'foot';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -5,7 +5,6 @@ import 'package:angel_orm/angel_orm.dart';
|
|||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
import 'customer.dart';
|
||||
part 'order.g.dart';
|
||||
part 'order.serializer.g.dart';
|
||||
|
||||
@orm
|
||||
@serializable
|
||||
|
|
|
@ -221,3 +221,73 @@ class Order extends _Order {
|
|||
return OrderSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class OrderSerializer {
|
||||
static Order fromMap(Map map) {
|
||||
return new Order(
|
||||
id: map['id'] as String,
|
||||
customerId: map['customer_id'] as int,
|
||||
employeeId: map['employee_id'] as int,
|
||||
orderDate: map['order_date'] != null
|
||||
? (map['order_date'] is DateTime
|
||||
? (map['order_date'] as DateTime)
|
||||
: DateTime.parse(map['order_date'].toString()))
|
||||
: null,
|
||||
shipperId: map['shipper_id'] as int,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Order model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'customer_id': model.customerId,
|
||||
'employee_id': model.employeeId,
|
||||
'order_date': model.orderDate?.toIso8601String(),
|
||||
'shipper_id': model.shipperId,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class OrderFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
customerId,
|
||||
employeeId,
|
||||
orderDate,
|
||||
shipperId,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String customerId = 'customer_id';
|
||||
|
||||
static const String employeeId = 'employee_id';
|
||||
|
||||
static const String orderDate = 'order_date';
|
||||
|
||||
static const String shipperId = 'shipper_id';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.order;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class OrderSerializer {
|
||||
static Order fromMap(Map map) {
|
||||
return new Order(
|
||||
id: map['id'] as String,
|
||||
customerId: map['customer_id'] as int,
|
||||
employeeId: map['employee_id'] as int,
|
||||
orderDate: map['order_date'] != null
|
||||
? (map['order_date'] is DateTime
|
||||
? (map['order_date'] as DateTime)
|
||||
: DateTime.parse(map['order_date'].toString()))
|
||||
: null,
|
||||
shipperId: map['shipper_id'] as int,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Order model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'customer_id': model.customerId,
|
||||
'employee_id': model.employeeId,
|
||||
'order_date': model.orderDate?.toIso8601String(),
|
||||
'shipper_id': model.shipperId,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class OrderFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
customerId,
|
||||
employeeId,
|
||||
orderDate,
|
||||
shipperId,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String customerId = 'customer_id';
|
||||
|
||||
static const String employeeId = 'employee_id';
|
||||
|
||||
static const String orderDate = 'order_date';
|
||||
|
||||
static const String shipperId = 'shipper_id';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -4,8 +4,6 @@ import 'package:angel_model/angel_model.dart';
|
|||
import 'package:angel_orm/angel_orm.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'role.g.dart';
|
||||
part 'role.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
class _Role extends Model {
|
||||
|
|
|
@ -139,3 +139,54 @@ class Role extends _Role {
|
|||
return RoleSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class RoleSerializer {
|
||||
static Role fromMap(Map map) {
|
||||
return new Role(
|
||||
id: map['id'] as String,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Role model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class RoleFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.role;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class RoleSerializer {
|
||||
static Role fromMap(Map map) {
|
||||
return new Role(
|
||||
id: map['id'] as String,
|
||||
name: map['name'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Role model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'name': model.name,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class RoleFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
name,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String name = 'name';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -6,7 +6,6 @@ import 'package:angel_serialize/angel_serialize.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'fruit.dart';
|
||||
part 'tree.g.dart';
|
||||
part 'tree.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -195,3 +195,63 @@ class Tree extends _Tree {
|
|||
return TreeSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class TreeSerializer {
|
||||
static Tree fromMap(Map map) {
|
||||
return new Tree(
|
||||
id: map['id'] as String,
|
||||
rings: map['rings'] as int,
|
||||
fruits: map['fruits'] is Iterable
|
||||
? new List.unmodifiable(((map['fruits'] as Iterable)
|
||||
.where((x) => x is Map) as Iterable<Map>)
|
||||
.map(FruitSerializer.fromMap))
|
||||
: null,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Tree model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'rings': model.rings,
|
||||
'fruits': model.fruits?.map((m) => m.toJson())?.toList(),
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class TreeFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
rings,
|
||||
fruits,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String rings = 'rings';
|
||||
|
||||
static const String fruits = 'fruits';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.tree;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class TreeSerializer {
|
||||
static Tree fromMap(Map map) {
|
||||
return new Tree(
|
||||
id: map['id'] as String,
|
||||
rings: map['rings'] as int,
|
||||
fruits: map['fruits'] is Iterable
|
||||
? new List.unmodifiable(((map['fruits'] as Iterable)
|
||||
.where((x) => x is Map) as Iterable<Map>)
|
||||
.map(FruitSerializer.fromMap))
|
||||
: null,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(Tree model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'rings': model.rings,
|
||||
'fruits': model.fruits?.map((m) => m.toJson())?.toList(),
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class TreeFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
rings,
|
||||
fruits,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String rings = 'rings';
|
||||
|
||||
static const String fruits = 'fruits';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
|
@ -6,7 +6,6 @@ import 'package:angel_serialize/angel_serialize.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'role.dart';
|
||||
part 'user.g.dart';
|
||||
part 'user.serializer.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
|
|
|
@ -187,3 +187,64 @@ class User extends _User {
|
|||
return UserSerializer.toMap(this);
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class UserSerializer {
|
||||
static User fromMap(Map map) {
|
||||
return new User(
|
||||
id: map['id'] as String,
|
||||
username: map['username'] as String,
|
||||
password: map['password'] as String,
|
||||
email: map['email'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(User model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'username': model.username,
|
||||
'password': model.password,
|
||||
'email': model.email,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class UserFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
email,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String username = 'username';
|
||||
|
||||
static const String password = 'password';
|
||||
|
||||
static const String email = 'email';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of angel_orm_generator.test.models.user;
|
||||
|
||||
// **************************************************************************
|
||||
// SerializerGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class UserSerializer {
|
||||
static User fromMap(Map map) {
|
||||
return new User(
|
||||
id: map['id'] as String,
|
||||
username: map['username'] as String,
|
||||
password: map['password'] as String,
|
||||
email: map['email'] as String,
|
||||
createdAt: map['created_at'] != null
|
||||
? (map['created_at'] is DateTime
|
||||
? (map['created_at'] as DateTime)
|
||||
: DateTime.parse(map['created_at'].toString()))
|
||||
: null,
|
||||
updatedAt: map['updated_at'] != null
|
||||
? (map['updated_at'] is DateTime
|
||||
? (map['updated_at'] as DateTime)
|
||||
: DateTime.parse(map['updated_at'].toString()))
|
||||
: null);
|
||||
}
|
||||
|
||||
static Map<String, dynamic> toMap(User model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
'id': model.id,
|
||||
'username': model.username,
|
||||
'password': model.password,
|
||||
'email': model.email,
|
||||
'created_at': model.createdAt?.toIso8601String(),
|
||||
'updated_at': model.updatedAt?.toIso8601String()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
abstract class UserFields {
|
||||
static const List<String> allFields = const <String>[
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
email,
|
||||
createdAt,
|
||||
updatedAt
|
||||
];
|
||||
|
||||
static const String id = 'id';
|
||||
|
||||
static const String username = 'username';
|
||||
|
||||
static const String password = 'password';
|
||||
|
||||
static const String email = 'email';
|
||||
|
||||
static const String createdAt = 'created_at';
|
||||
|
||||
static const String updatedAt = 'updated_at';
|
||||
}
|
Loading…
Reference in a new issue