24 lines
679 B
JavaScript
24 lines
679 B
JavaScript
module.exports = mongoose => {
|
|
var schema = mongoose.Schema(
|
|
{
|
|
title: String,
|
|
chinese: String,
|
|
english: String,
|
|
status: String,
|
|
create_by: String,
|
|
create_date: Date,
|
|
edit_by: String,
|
|
edit_date: Date,
|
|
site: Number
|
|
},
|
|
{ collection: 'msg_custom_template', timestamps: true }
|
|
);
|
|
schema.method("toJSON", function() {
|
|
const { __v, _id, ...object } = this.toObject();
|
|
object.id = _id;
|
|
return object;
|
|
});
|
|
const MsgCustomTemplate = mongoose.model("msg_custom_template", schema);
|
|
return MsgCustomTemplate;
|
|
};
|