Files
wechatWeb/api/model/biz_plan.js
张成 2f04459492 1
2026-03-27 13:14:10 +08:00

70 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const Sequelize = require("sequelize");
module.exports = (db) => {
const biz_plan = db.define(
"biz_plan",
{
id: {
type: Sequelize.BIGINT.UNSIGNED,
primaryKey: true,
autoIncrement: true,
},
plan_code: {
type: Sequelize.STRING(64),
allowNull: false,
unique: true,
},
plan_name: {
type: Sequelize.STRING(128),
allowNull: false,
defaultValue: "",
},
monthly_price: {
type: Sequelize.DECIMAL(12, 2),
allowNull: false,
defaultValue: 0,
},
auth_fee: {
type: Sequelize.DECIMAL(12, 2),
allowNull: false,
defaultValue: 0,
},
account_limit: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
active_user_limit: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
msg_quota: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
mass_quota: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
friend_quota: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
sns_quota: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 },
enabled_features: {
type: Sequelize.JSON,
allowNull: true,
comment: "JSON 功能点白名单",
},
allowed_apis: {
type: Sequelize.JSON,
allowNull: true,
comment: "可访问的接口路径列表,如 [\"/user/GetProfile\",\"/message/SendText\"]null 表示不限制",
},
api_call_quota: {
type: Sequelize.INTEGER,
allowNull: false,
defaultValue: 0,
comment: "每月 API 总调用次数上限0=不限制",
},
status: {
type: Sequelize.ENUM("active", "inactive"),
allowNull: false,
defaultValue: "active",
},
},
{
tableName: "biz_plans",
timestamps: false,
underscored: true,
comment: "套餐",
}
);
// biz_plan.sync({ alter: true });
return biz_plan;
};