Create Log Save System
This commit is contained in:
@@ -2,6 +2,21 @@ const mongoose = require("mongoose");
|
||||
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const deviceLogSchema = new Schema({
|
||||
remote_name: {
|
||||
type: String
|
||||
},
|
||||
remote_type: {
|
||||
type: String
|
||||
},
|
||||
operating_type:{
|
||||
type: String // On/Off - Homekit Reset - Reset
|
||||
},
|
||||
log_time: {
|
||||
type: Date
|
||||
}
|
||||
});
|
||||
|
||||
const deviceSchema = new Schema({
|
||||
device_name: {
|
||||
type: String,
|
||||
@@ -26,7 +41,11 @@ const deviceSchema = new Schema({
|
||||
device_ip_address: {
|
||||
type: String,
|
||||
unique: true
|
||||
}
|
||||
},
|
||||
update_time: {
|
||||
type: Date
|
||||
},
|
||||
device_log: [deviceLogSchema]
|
||||
});
|
||||
|
||||
const Device = mongoose.model("Device", deviceSchema);
|
||||
|
||||
Reference in New Issue
Block a user