feat: separate db models from server

This commit is contained in:
wancat committed 2023-10-14 15:34:46 +08:00
1 parent 784ae29ed0
commit 50bf514805
23 files changed
+90 -31

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import { model, Schema } from 'mongoose'
const Command = model(
'Command',
new Schema(
{
session: {
type: Schema.ObjectId,
ref: 'Session',
required: true,
},
pwd: {
type: String,
required: true,
},
command: {
type: String,
required: true,
},
output: {
type: String,
required: false,
},
error: {
type: String,
required: false,
},
},
{ timestamps: true }
)
)
export default Command