feat: implement some api; add md editor to app; login and signup logic.
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:angel3_migration/angel3_migration.dart';
|
||||
import 'package:angel3_serialize/angel3_serialize.dart';
|
||||
import 'package:angel3_orm/angel3_orm.dart';
|
||||
import 'package:dde_gesture_manager_api/src/models/base_model.dart';
|
||||
import 'package:optional/optional.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
part 'user.g.dart';
|
||||
|
||||
@serializable
|
||||
@orm
|
||||
abstract class _User extends BaseModel {
|
||||
@Column(isNullable: false, indexType: IndexType.unique)
|
||||
@SerializableField(isNullable: false)
|
||||
String? get email;
|
||||
|
||||
@SerializableField(isNullable: false)
|
||||
@Column(isNullable: false, length: 32)
|
||||
@SerializableField(isNullable: true, exclude: true)
|
||||
String? get password;
|
||||
|
||||
@SerializableField(isNullable: false)
|
||||
String? get token;
|
||||
}
|
||||
String secret(String salt) => base64.encode(Hmac(sha256, salt.codeUnits).convert((password ?? '').codeUnits).bytes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user