Giter Site home page Giter Site logo

leno-admin's People

Contributors

773579084 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leno-admin's Issues

monitor

监控机器cpu等信息是如何做的?同服务做 那服务打满的时候也记录不了cpu了

使用Sequelize 自带逻辑删除标记的功能,并添加必须的事务逻辑

如题,可以对数据表的结构进行更新,使用sequelize自带的功能,自动维护更新创建时间,更新时间和删除标记

// sequelize create
define: {
    ...,
    charset: 'utf8',
    paranoid: true,
  },

在需要物理删除的时候,在sql中使用

Model.destroy({
    where: {
      ...,
    },
    force: true
  })

另外现在的增删改是没有事务操作的,不知道是不是遗漏了

首次启动服务端时,创建表语句报错

@773579084 /leno-admin/backend 项目中 sys_menu.order_num 的类型错误:

Executing (default): CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE  COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';
数据库连接失败 Error: 
    at Query.run (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/dialects/mysql/query.js:46:25)
    at /Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/sequelize.js:650:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at MySQLQueryInterface.createTable (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/dialects/abstract/query-interface.js:229:12)
    at Function.sync (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/model.js:1353:7)
    at Sequelize.sync (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/sequelize.js:825:9) {
  name: 'SequelizeDatabaseError',
  parent: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1
      at Packet.asError (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packets/packet.js:728:17)
      at Query.execute (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/commands/command.js:29:26)
      at Connection.handlePacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:456:32)
      at PacketParser.onPacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:85:12)
      at PacketParser.executeStart (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packet_parser.js:75:16)
      at Socket.<anonymous> (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:92:25)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
    code: 'ER_PARSE_ERROR',
    errno: 1064,
    sqlState: '42000',
    sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1",
    sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE  COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
    parameters: undefined
  },
  original: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1
      at Packet.asError (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packets/packet.js:728:17)
      at Query.execute (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/commands/command.js:29:26)
      at Connection.handlePacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:456:32)
      at PacketParser.onPacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:85:12)
      at PacketParser.executeStart (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packet_parser.js:75:16)
      at Socket.<anonymous> (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:92:25)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
    code: 'ER_PARSE_ERROR',
    errno: 1064,
    sqlState: '42000',
    sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1",
    sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE  COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
    parameters: undefined
  },
  sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE  COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
  parameters: {}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.