From 433077f08a36d0b1963c0ae630f446735dc92b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90?= Date: Wed, 1 Apr 2026 10:42:33 +0800 Subject: [PATCH] 1 --- .vscode/launch.json | 18 +++++++++--------- api/model/biz_api_call_log.js | 18 +----------------- api/model/biz_api_token.js | 7 ------- api/model/biz_audit_log.js | 1 - api/model/biz_plan.js | 4 ---- api/model/biz_subscription.js | 1 - api/model/biz_usage_monthly.js | 4 ---- api/model/biz_user.js | 5 ----- api/model/sys_control_type.js | 3 --- api/model/sys_log.js | 3 --- api/model/sys_menu.js | 12 ------------ api/model/sys_parameter.js | 4 ---- api/model/sys_role.js | 3 --- api/model/sys_user.js | 3 --- 14 files changed, 10 insertions(+), 76 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ef0223a..6d7d7dd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,13 @@ { "configurations": [ - { - "name": "启动", - "program": "${workspaceFolder}/app.js", - "request": "launch", - "skipFiles": [ - "/**" - ], - "type": "node" - } + { + "name": "启动后端", + "program": "${workspaceFolder}/app.js", + "request": "launch", + "skipFiles": [ + "/**" + ], + "type": "node" + } ] } \ No newline at end of file diff --git a/api/model/biz_api_call_log.js b/api/model/biz_api_call_log.js index c87a0e2..d85b886 100644 --- a/api/model/biz_api_call_log.js +++ b/api/model/biz_api_call_log.js @@ -8,17 +8,14 @@ module.exports = (db) => { user_id: { type: Sequelize.BIGINT.UNSIGNED, allowNull: false, - comment: "业务用户ID", }, token_id: { type: Sequelize.BIGINT.UNSIGNED, allowNull: false, - comment: "使用的Token ID", }, api_path: { type: Sequelize.STRING(200), allowNull: false, - comment: "接口路径,如 /user/GetProfile", }, http_method: { type: Sequelize.STRING(10), @@ -29,18 +26,15 @@ module.exports = (db) => { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0, - comment: "上游返回的HTTP状态码", }, response_time: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0, - comment: "上游响应耗时ms", }, call_date: { type: Sequelize.DATEONLY, allowNull: false, - comment: "调用日期,方便按天统计", }, created_at: { type: Sequelize.DATE, @@ -48,17 +42,7 @@ module.exports = (db) => { defaultValue: Sequelize.NOW, }, }, - { - tableName: "biz_api_call_log", - timestamps: false, - underscored: true, - comment: "API调用日志", - indexes: [ - { fields: ["user_id", "call_date"], name: "idx_user_date" }, - { fields: ["api_path", "call_date"], name: "idx_api_date" }, - { fields: ["user_id", "api_path"], name: "idx_user_api" }, - ], - } + ); return biz_api_call_log; }; diff --git a/api/model/biz_api_token.js b/api/model/biz_api_token.js index d3aaa4b..1918b58 100644 --- a/api/model/biz_api_token.js +++ b/api/model/biz_api_token.js @@ -12,7 +12,6 @@ module.exports = (db) => { plan_id: { type: Sequelize.BIGINT.UNSIGNED, allowNull: true, - comment: "冗余:鉴权时少联表", }, token_name: { type: Sequelize.STRING(100), @@ -32,12 +31,6 @@ module.exports = (db) => { expire_at: { type: Sequelize.DATE, allowNull: false }, last_used_at: { type: Sequelize.DATE, allowNull: true }, }, - { - tableName: "biz_api_tokens", - timestamps: false, - underscored: true, - comment: "API Token", - } ); // biz_api_token.sync({ force: true }); return biz_api_token; diff --git a/api/model/biz_audit_log.js b/api/model/biz_audit_log.js index 02ee526..107125e 100644 --- a/api/model/biz_audit_log.js +++ b/api/model/biz_audit_log.js @@ -35,7 +35,6 @@ module.exports = (db) => { tableName: "biz_audit_log", timestamps: false, underscored: true, - comment: "审计日志", } ); // biz_audit_log.sync({ alter: true }); diff --git a/api/model/biz_plan.js b/api/model/biz_plan.js index ff8b958..ffb377e 100644 --- a/api/model/biz_plan.js +++ b/api/model/biz_plan.js @@ -34,18 +34,15 @@ module.exports = (db) => { 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"), @@ -57,7 +54,6 @@ module.exports = (db) => { tableName: "biz_plans", timestamps: false, underscored: true, - comment: "套餐", } ); // biz_plan.sync({ alter: true }); diff --git a/api/model/biz_subscription.js b/api/model/biz_subscription.js index 6c35a4c..f9ff0ba 100644 --- a/api/model/biz_subscription.js +++ b/api/model/biz_subscription.js @@ -38,7 +38,6 @@ module.exports = (db) => { tableName: "biz_subscriptions", timestamps: false, underscored: true, - comment: "订阅", } ); // biz_subscription.sync({ alter: true }); diff --git a/api/model/biz_usage_monthly.js b/api/model/biz_usage_monthly.js index 56b9a17..4880c9e 100644 --- a/api/model/biz_usage_monthly.js +++ b/api/model/biz_usage_monthly.js @@ -16,7 +16,6 @@ module.exports = (db) => { stat_month: { type: Sequelize.STRING(7), allowNull: false, - comment: "YYYY-MM", }, msg_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, mass_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, @@ -27,14 +26,11 @@ module.exports = (db) => { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0, - comment: "当月 API 转发总调用次数", }, }, { - tableName: "biz_usage_monthly", timestamps: false, underscored: true, - comment: "月用量", } ); // biz_usage_monthly.sync({ alter: true }); diff --git a/api/model/biz_user.js b/api/model/biz_user.js index 18fbcfb..d48d8ec 100644 --- a/api/model/biz_user.js +++ b/api/model/biz_user.js @@ -9,12 +9,10 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "姓名/称呼", }, mobile: { type: Sequelize.STRING(20), allowNull: true, - comment: "手机号", }, email: { type: Sequelize.STRING(120), @@ -23,7 +21,6 @@ module.exports = (db) => { company_name: { type: Sequelize.STRING(200), allowNull: true, - comment: "公司名", }, status: { type: Sequelize.ENUM("active", "disabled"), @@ -32,12 +29,10 @@ module.exports = (db) => { }, }, { - // 与库表名一致:单数 biz_user(与模型名一致,避免部分环境下 tableName 未生效时落到默认表名 biz_user) tableName: "biz_user", freezeTableName: true, timestamps: false, underscored: true, - comment: "业务用户", } ); // biz_user.sync({ alter: true }); diff --git a/api/model/sys_control_type.js b/api/model/sys_control_type.js index 0eb6945..b9bc6e5 100644 --- a/api/model/sys_control_type.js +++ b/api/model/sys_control_type.js @@ -6,19 +6,16 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "控件名称", }, module_key: { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "组件key", }, data_lenght: { type: Sequelize.INTEGER(11), allowNull: false, defaultValue: "50", - comment: "数据长度", }, }); }; diff --git a/api/model/sys_log.js b/api/model/sys_log.js index ea64fc1..d82e332 100644 --- a/api/model/sys_log.js +++ b/api/model/sys_log.js @@ -7,19 +7,16 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "表名", }, operate: { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "操作", }, content: { type: Sequelize.JSON, allowNull: false, defaultValue: "", - comment: "内容", set(value) { this.setDataValue("content", { value }); }, diff --git a/api/model/sys_menu.js b/api/model/sys_menu.js index 74d2417..750deba 100644 --- a/api/model/sys_menu.js +++ b/api/model/sys_menu.js @@ -8,27 +8,23 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "菜单名称", }, // 父id parent_id: { type: Sequelize.INTEGER(11).UNSIGNED, allowNull: true, defaultValue: 0, - comment: "父id", }, // 图标 icon: { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "图标", }, path: { type: Sequelize.STRING(255), allowNull: false, defaultValue: "", - comment: "路径", }, // 菜单类型 "菜单", "页面", "外链", "功能" @@ -36,14 +32,12 @@ module.exports = (db) => { type: Sequelize.STRING(255), allowNull: false, defaultValue: "页面", - comment: "菜单类型", }, //模型id model_id: { type: Sequelize.INTEGER(11).UNSIGNED, allowNull: true, defaultValue: 0, - comment: "模型id", }, //表单id @@ -51,7 +45,6 @@ module.exports = (db) => { type: Sequelize.INTEGER(11).UNSIGNED, allowNull: true, defaultValue: 0, - comment: "表单id", }, // 组件地址 @@ -59,7 +52,6 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "组件地址", }, // api地址 @@ -67,20 +59,17 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "api地址", }, // 是否显示在菜单中 is_show_menu: { type: Sequelize.INTEGER(1), allowNull: false, defaultValue: true, - comment: "是否显示在菜单中", }, is_show: { type: Sequelize.INTEGER(1), allowNull: false, defaultValue: true, - comment: "是否展示", }, // 菜单类型 @@ -88,7 +77,6 @@ module.exports = (db) => { type: Sequelize.INTEGER(11), allowNull: false, defaultValue: "0", - comment: "菜单类型", }, }); }; diff --git a/api/model/sys_parameter.js b/api/model/sys_parameter.js index b1e9a07..6703b7d 100644 --- a/api/model/sys_parameter.js +++ b/api/model/sys_parameter.js @@ -7,21 +7,18 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "字典key", }, value: { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "值", }, remark: { type: Sequelize.STRING(500), allowNull: false, defaultValue: "", - comment: "备注", }, // 是否允许修改 0 允许,1 不允许 @@ -29,7 +26,6 @@ module.exports = (db) => { type: Sequelize.INTEGER(2), allowNull: false, defaultValue: 0, - comment: "是否允许修改", }, }); }; diff --git a/api/model/sys_role.js b/api/model/sys_role.js index 486d407..694e3b0 100644 --- a/api/model/sys_role.js +++ b/api/model/sys_role.js @@ -7,20 +7,17 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "角色名称", }, // 0 普通角色 1 系统角色 type: { type: Sequelize.INTEGER(1), allowNull: false, defaultValue: "0", - comment: "角色类型", }, menus: { type: Sequelize.JSON, allowNull: false, defaultValue: "", - comment: "权限菜单", set(value) { this.setDataValue('menus', { value }); }, diff --git a/api/model/sys_user.js b/api/model/sys_user.js index a8ea151..ff78a67 100644 --- a/api/model/sys_user.js +++ b/api/model/sys_user.js @@ -7,18 +7,15 @@ module.exports = (db) => { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "名称", }, password: { type: Sequelize.STRING(100), allowNull: false, defaultValue: "", - comment: "密码", }, roleId: { type: Sequelize.INTEGER, allowNull: false, - comment: "角色id", }, }); };