🚧 refactoring is ongoing

This commit is contained in:
Song
2021-01-17 10:49:19 +08:00
parent aa2635afcd
commit 22975603c6
20 changed files with 327 additions and 199 deletions
+48
View File
@@ -0,0 +1,48 @@
const { DataTypes, Model } = require('sequelize');
const sequelize = require('../common/database');
class User extends Model {}
User.init(
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
username: {
type: DataTypes.STRING,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
accessToken: {
type: DataTypes.STRING,
defaultValue: '',
},
email: {
type: DataTypes.STRING,
},
prefix: {
type: DataTypes.STRING,
unique: true,
},
isAdmin: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
isBlocked: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
wechatAppId: DataTypes.STRING,
wechatAppSecret: DataTypes.STRING,
wechatTemplateId: DataTypes.STRING,
wechatOpenId: DataTypes.STRING,
},
{ sequelize }
);
module.exports = User;