WMS_MAIN/app/model/system_log.js
liufumingren dc4894cb6d 1
2026-05-25 17:08:56 +08:00

95 lines
1.8 KiB
JavaScript

// app/model/system_log.js
'use strict';
module.exports = app => {
const { BIGINT, STRING, TEXT, DATE, INTEGER } = app.Sequelize;
const SystemLog = app.model.define('wms_system_log', {
id: {
type: BIGINT.UNSIGNED,
primaryKey: true,
autoIncrement: true,
allowNull: false,
comment: 'ID',
},
method: {
type: STRING(100),
allowNull: true,
comment: '方法名',
},
v: {
type: STRING(50),
allowNull: true,
comment: '版本',
},
url: {
type: TEXT,
allowNull: true,
comment: '请求URL',
},
created_at: {
type: DATE,
allowNull: true,
comment: '创建时间',
},
body: {
type: TEXT('long'),
allowNull: true,
comment: '请求体',
},
result: {
type: TEXT('long'),
allowNull: true,
comment: '响应体',
},
use_time: {
type: INTEGER,
allowNull: true,
comment: '耗时',
},
updated_at: {
type: DATE,
allowNull: true,
comment: '更新时间',
},
delete_at: {
type: DATE,
allowNull: true,
comment: '删除时间',
},
headers: {
type: TEXT,
allowNull: true,
comment: '请求头',
},
auth: {
type: TEXT,
allowNull: true,
comment: '认证信息',
},
store_id: {
type: BIGINT.UNSIGNED,
allowNull: true,
comment: '门店ID',
},
device: {
type: STRING(100),
allowNull: true,
comment: '设备',
},
}, {
tableName: 'wms_system_log',
timestamps: false,
underscored: false,
comment: '系统日志表',
indexes: [
{
name: 'store_id',
fields: [ 'store_id' ],
},
],
});
return SystemLog;
};