Update user.dart
This commit is contained in:
parent
7b90bc22a7
commit
b29ad2c807
1 changed files with 3 additions and 18 deletions
|
@ -1,26 +1,11 @@
|
||||||
library angel.models.user;
|
library angel.models.user;
|
||||||
|
|
||||||
import 'package:angel_mongo/model.dart';
|
import 'package:angel_framework/common.dart';
|
||||||
import 'package:source_gen/generators/json_serializable.dart';
|
|
||||||
|
|
||||||
part 'user.g.dart';
|
class User extends Model {
|
||||||
|
String email, username, password;
|
||||||
@JsonSerializable()
|
|
||||||
class User extends Model with _$UserSerializerMixin {
|
|
||||||
@JsonKey('email')
|
|
||||||
String email;
|
|
||||||
|
|
||||||
@JsonKey('username')
|
|
||||||
String username;
|
|
||||||
|
|
||||||
@JsonKey('password')
|
|
||||||
String password;
|
|
||||||
|
|
||||||
@JsonKey('roles')
|
|
||||||
final List<String> roles = [];
|
final List<String> roles = [];
|
||||||
|
|
||||||
factory User.fromJson(Map json) => _$UserFromJson(json);
|
|
||||||
|
|
||||||
User(
|
User(
|
||||||
{String id,
|
{String id,
|
||||||
this.email,
|
this.email,
|
||||||
|
|
Loading…
Reference in a new issue