swagger documentation for Api

This commit is contained in:
2025-01-30 12:44:04 +05:30
parent 5984f445f7
commit 465f713624
45 changed files with 5201 additions and 2308 deletions

View File

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