🎉 wechat corp message supported

This commit is contained in:
Song
2021-03-28 11:15:57 +08:00
parent 7478128b6b
commit 4713373c54
10 changed files with 184 additions and 29 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ const sequelize = require('../common/database');
Message.belongsTo(User);
(async () => {
await sequelize.sync({ alter: true });
await sequelize.sync();
console.log('Database initialized.');
const isNoAdminExisted =
(await User.findOne({ where: { isAdmin: true } })) === null;
+2 -2
View File
@@ -14,8 +14,8 @@ Message.init(
description: DataTypes.TEXT,
content: DataTypes.TEXT,
type: {
type: DataTypes.INTEGER,
defaultValue: 0,
type: DataTypes.STRING,
defaultValue: 'test',
},
},
{ sequelize }
+11
View File
@@ -37,17 +37,28 @@ User.init(
type: DataTypes.BOOLEAN,
defaultValue: false,
},
defaultMethod:{
type: DataTypes.STRING,
defaultValue: 'test'
},
// WeChat public account
wechatAppId: DataTypes.STRING,
wechatAppSecret: DataTypes.STRING,
wechatTemplateId: DataTypes.STRING,
wechatOpenId: DataTypes.STRING,
wechatVerifyToken: DataTypes.STRING,
// Email
smtpServer: {
type: DataTypes.STRING,
defaultValue: 'smtp.qq.com',
},
smtpUser: DataTypes.STRING,
smtpPass: DataTypes.STRING,
// WeChat corporation
corpId: DataTypes.STRING,
corpAgentId: DataTypes.STRING,
corpAppSecret: DataTypes.STRING,
corpUserId: DataTypes.STRING
},
{ sequelize }
);