init
This commit is contained in:
37
api/model/sys_log.js
Normal file
37
api/model/sys_log.js
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
const Sequelize = require("sequelize");
|
||||
// db日志管理
|
||||
module.exports = (db) => {
|
||||
return db.define("sys_log", {
|
||||
table_name: {
|
||||
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 });
|
||||
},
|
||||
get() {
|
||||
let jsonValue = this.getDataValue("content");
|
||||
if (jsonValue && jsonValue.value !== undefined) {
|
||||
return jsonValue.value;
|
||||
} else {
|
||||
return jsonValue;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user