Create Log Save System

This commit is contained in:
2024-03-05 00:26:10 +03:00
parent a5b7d0edfe
commit c55b16d259
6 changed files with 105 additions and 18 deletions

View File

@@ -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);