swagger documentation for Api
This commit is contained in:
@@ -1,57 +1,57 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface floorItenms extends Document {
|
||||
modeluuid: string;
|
||||
modelfileID: string;
|
||||
modelname: string
|
||||
isLocked:boolean
|
||||
isVisible:boolean
|
||||
position: []
|
||||
rotation: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const floorItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String },
|
||||
modelfileID: { type: String },
|
||||
modelname: { type: String },
|
||||
position: { type: Array},
|
||||
isLocked:{type:Boolean},
|
||||
isVisible:{type:Boolean},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const floorItemsModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<floorItenms>('floorItenms', floorItenmsSchema,`floorItenms`);
|
||||
// }
|
||||
|
||||
// export default floorItemsModel;
|
||||
const floorItemsModel = (db:string) => {
|
||||
return MainModel(db, "floorItems", floorItemsSchema, "floorItems")
|
||||
};
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface floorItenms extends Document {
|
||||
modeluuid: string;
|
||||
modelfileID: string;
|
||||
modelname: string
|
||||
isLocked:boolean
|
||||
isVisible:boolean
|
||||
position: []
|
||||
rotation: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const floorItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String },
|
||||
modelfileID: { type: String },
|
||||
modelname: { type: String },
|
||||
position: { type: Array},
|
||||
isLocked:{type:Boolean},
|
||||
isVisible:{type:Boolean},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const floorItemsModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<floorItenms>('floorItenms', floorItenmsSchema,`floorItenms`);
|
||||
// }
|
||||
|
||||
// export default floorItemsModel;
|
||||
const floorItemsModel = (db:string) => {
|
||||
return MainModel(db, "floorItems", floorItemsSchema, "floorItems")
|
||||
};
|
||||
export default floorItemsModel;
|
||||
@@ -1,46 +1,46 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface wallitems extends Document {
|
||||
modeluuid: string;
|
||||
modelname: string
|
||||
type: string
|
||||
csgposition: []
|
||||
csgscale: []
|
||||
position: []
|
||||
quaternion: []
|
||||
scale: []
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const wallItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String,unique:true },
|
||||
modelname: { type: String},
|
||||
type: { type: String },
|
||||
csgposition: { type: Array},
|
||||
csgscale: { type: Array,},
|
||||
position: { type: Array },
|
||||
quaternion: { type: Array},
|
||||
scale: { type: Array}
|
||||
});
|
||||
|
||||
// const wallItenmModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<wallitenms>('wallitenms', wallItenmsSchema, `wallitenms`);
|
||||
// }
|
||||
|
||||
// export default wallItenmModel;
|
||||
const wallItenmModel = (db:string) => {
|
||||
return MainModel(db, "wallitems", wallItemsSchema, "wallitems")
|
||||
};
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface wallitems extends Document {
|
||||
modeluuid: string;
|
||||
modelname: string
|
||||
type: string
|
||||
csgposition: []
|
||||
csgscale: []
|
||||
position: []
|
||||
quaternion: []
|
||||
scale: []
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const wallItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String,unique:true },
|
||||
modelname: { type: String},
|
||||
type: { type: String },
|
||||
csgposition: { type: Array},
|
||||
csgscale: { type: Array,},
|
||||
position: { type: Array },
|
||||
quaternion: { type: Array},
|
||||
scale: { type: Array}
|
||||
});
|
||||
|
||||
// const wallItenmModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<wallitenms>('wallitenms', wallItenmsSchema, `wallitenms`);
|
||||
// }
|
||||
|
||||
// export default wallItenmModel;
|
||||
const wallItenmModel = (db:string) => {
|
||||
return MainModel(db, "wallitems", wallItemsSchema, "wallitems")
|
||||
};
|
||||
export default wallItenmModel;
|
||||
@@ -1,87 +1,87 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Camera extends Document {
|
||||
userId: string;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const cameraSchema: Schema = new Schema({
|
||||
userId: { type: String },
|
||||
position: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
},
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const cameraModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<Camera>('Camera', cameraSchema,`Camera`);
|
||||
// }
|
||||
|
||||
// export default cameraModel;
|
||||
// const cameraModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db,
|
||||
// serverSelectionTimeoutMS: 60000, // Increased timeout
|
||||
// });
|
||||
|
||||
// dbConnection.on('error', (err) => {
|
||||
// console.error(`MongoDB connection error for database ${db}:`, err);
|
||||
// });
|
||||
|
||||
// dbConnection.once('open', () => {
|
||||
// console.log(`Connected to MongoDB database: ${db}`);
|
||||
// });
|
||||
|
||||
// return dbConnection.model<Camera>('Camera', cameraSchema, 'Camera');
|
||||
// };
|
||||
// export default cameraModel
|
||||
const cameraModel = (db:string) => {
|
||||
return MainModel(db, "Camera", cameraSchema, "Camera")
|
||||
};
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Camera extends Document {
|
||||
userId: string;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const cameraSchema: Schema = new Schema({
|
||||
userId: { type: String },
|
||||
position: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
},
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true }
|
||||
}
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const cameraModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<Camera>('Camera', cameraSchema,`Camera`);
|
||||
// }
|
||||
|
||||
// export default cameraModel;
|
||||
// const cameraModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db,
|
||||
// serverSelectionTimeoutMS: 60000, // Increased timeout
|
||||
// });
|
||||
|
||||
// dbConnection.on('error', (err) => {
|
||||
// console.error(`MongoDB connection error for database ${db}:`, err);
|
||||
// });
|
||||
|
||||
// dbConnection.once('open', () => {
|
||||
// console.log(`Connected to MongoDB database: ${db}`);
|
||||
// });
|
||||
|
||||
// return dbConnection.model<Camera>('Camera', cameraSchema, 'Camera');
|
||||
// };
|
||||
// export default cameraModel
|
||||
const cameraModel = (db:string) => {
|
||||
return MainModel(db, "Camera", cameraSchema, "Camera")
|
||||
};
|
||||
export default cameraModel;
|
||||
@@ -1,38 +1,38 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface environment extends Document {
|
||||
userId: string;
|
||||
roofVisibility:boolean
|
||||
wallVisibility:boolean
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const environmentSchema: Schema = new Schema({
|
||||
userId: { type: String, unique: true },
|
||||
roofVisibility: { type: Boolean ,default:false},
|
||||
wallVisibility: { type: Boolean ,default:false},
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const environmentModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<environment>('environments', environmentSchema,`environments`);
|
||||
// }
|
||||
|
||||
// export default environmentModel;
|
||||
const environmentModel = (db:string) => {
|
||||
return MainModel(db, "environments", environmentSchema, "environments")
|
||||
};
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface environment extends Document {
|
||||
userId: string;
|
||||
roofVisibility:boolean
|
||||
wallVisibility:boolean
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const environmentSchema: Schema = new Schema({
|
||||
userId: { type: String, unique: true },
|
||||
roofVisibility: { type: Boolean ,default:false},
|
||||
wallVisibility: { type: Boolean ,default:false},
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
// const cameraModel = model<Camera>("Camera", cameraSchema);
|
||||
|
||||
// export default cameraModel;
|
||||
// const environmentModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || '';
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error('MONGO_URI environment variable is not set');
|
||||
// }
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
// return dbConnection.model<environment>('environments', environmentSchema,`environments`);
|
||||
// }
|
||||
|
||||
// export default environmentModel;
|
||||
const environmentModel = (db:string) => {
|
||||
return MainModel(db, "environments", environmentSchema, "environments")
|
||||
};
|
||||
export default environmentModel;
|
||||
@@ -1,43 +1,43 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose";
|
||||
const positionSchema = new mongoose.Schema({
|
||||
x: { type: Number, }, // Optional position fields
|
||||
y: { type: Number, },
|
||||
z: { type: Number},
|
||||
});
|
||||
|
||||
// Define a schema for the individual line
|
||||
const Vector3 = new mongoose.Schema({
|
||||
position: { type: positionSchema, required: false }, // Optional position
|
||||
uuid: { type: String, required: false }, // Optional uuid
|
||||
});
|
||||
|
||||
// Define the main schema
|
||||
const LineSchema = new mongoose.Schema({
|
||||
layer: { type: Number, required: true }, // Layer is mandatory
|
||||
line: { type: [Vector3], required: true }, // Array of line objects
|
||||
type: { type: String, required: false }, // Optional type
|
||||
});
|
||||
|
||||
// Database connection and model creation
|
||||
// const lineModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || "";
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error("MONGO_URI environment variable is not set");
|
||||
// }
|
||||
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
|
||||
// // Return the model
|
||||
// return dbConnection.model("lines", LineSchema, "lines");
|
||||
// };
|
||||
|
||||
// export default lineModel;
|
||||
const lineModel = (db:string) => {
|
||||
return MainModel(db, "lines", LineSchema, "lines")
|
||||
};
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose";
|
||||
const positionSchema = new mongoose.Schema({
|
||||
x: { type: Number, }, // Optional position fields
|
||||
y: { type: Number, },
|
||||
z: { type: Number},
|
||||
});
|
||||
|
||||
// Define a schema for the individual line
|
||||
const Vector3 = new mongoose.Schema({
|
||||
position: { type: positionSchema, required: false }, // Optional position
|
||||
uuid: { type: String, required: false }, // Optional uuid
|
||||
});
|
||||
|
||||
// Define the main schema
|
||||
const LineSchema = new mongoose.Schema({
|
||||
layer: { type: Number, required: true }, // Layer is mandatory
|
||||
line: { type: [Vector3], required: true }, // Array of line objects
|
||||
type: { type: String, required: false }, // Optional type
|
||||
});
|
||||
|
||||
// Database connection and model creation
|
||||
// const lineModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || "";
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error("MONGO_URI environment variable is not set");
|
||||
// }
|
||||
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
|
||||
// // Return the model
|
||||
// return dbConnection.model("lines", LineSchema, "lines");
|
||||
// };
|
||||
|
||||
// export default lineModel;
|
||||
const lineModel = (db:string) => {
|
||||
return MainModel(db, "lines", LineSchema, "lines")
|
||||
};
|
||||
export default lineModel;
|
||||
@@ -1,69 +1,69 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../connect/mongoose";
|
||||
export interface User extends Document {
|
||||
userName: String;
|
||||
email: String;
|
||||
password: String;
|
||||
|
||||
role: String;
|
||||
profilePicture: String;
|
||||
isShare:Boolean,
|
||||
activeStatus:string
|
||||
|
||||
}
|
||||
const signupschema: Schema = new Schema({
|
||||
userName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
min: 8,
|
||||
required: true,
|
||||
},
|
||||
role: {
|
||||
type: String,
|
||||
default: "User",
|
||||
enum: ["User", "Admin", "Project Manager", "Manager", "Owner"],
|
||||
},
|
||||
profilePicture: {
|
||||
type: String,
|
||||
// default: "default-profile-picture.jpg"
|
||||
},
|
||||
isShare:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
activeStatus:{
|
||||
type:String,
|
||||
enum: ["online", "offline"],
|
||||
default: "offline"
|
||||
}
|
||||
|
||||
});
|
||||
// const userModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || "";
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error("MONGO_URI environment variable is not set");
|
||||
// }
|
||||
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
|
||||
// // Return the model
|
||||
// return dbConnection.model("Users", signupschema, "Users");
|
||||
// };
|
||||
|
||||
// export default userModel;
|
||||
const userModel = (db:string) => {
|
||||
return MainModel(db, "Users", signupschema, "Users")
|
||||
};
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../connect/mongoose";
|
||||
export interface User extends Document {
|
||||
userName: String;
|
||||
email: String;
|
||||
password: String;
|
||||
|
||||
role: String;
|
||||
profilePicture: String;
|
||||
isShare:Boolean,
|
||||
activeStatus:string
|
||||
|
||||
}
|
||||
const signupschema: Schema = new Schema({
|
||||
userName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
min: 8,
|
||||
required: true,
|
||||
},
|
||||
role: {
|
||||
type: String,
|
||||
default: "User",
|
||||
enum: ["User", "Admin", "Project Manager", "Manager", "Owner"],
|
||||
},
|
||||
profilePicture: {
|
||||
type: String,
|
||||
// default: "default-profile-picture.jpg"
|
||||
},
|
||||
isShare:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
activeStatus:{
|
||||
type:String,
|
||||
enum: ["online", "offline"],
|
||||
default: "offline"
|
||||
}
|
||||
|
||||
});
|
||||
// const userModel = (db: string) => {
|
||||
// const mongoUrl = process.env.MONGO_URI || "";
|
||||
// if (!mongoUrl) {
|
||||
// throw new Error("MONGO_URI environment variable is not set");
|
||||
// }
|
||||
|
||||
// // Connect to the database
|
||||
// const dbConnection = mongoose.createConnection(mongoUrl, {
|
||||
// dbName: db, // Specify the database name here
|
||||
// serverSelectionTimeoutMS: 30000,
|
||||
// });
|
||||
|
||||
// // Return the model
|
||||
// return dbConnection.model("Users", signupschema, "Users");
|
||||
// };
|
||||
|
||||
// export default userModel;
|
||||
const userModel = (db:string) => {
|
||||
return MainModel(db, "Users", signupschema, "Users")
|
||||
};
|
||||
export default userModel;
|
||||
Reference in New Issue
Block a user