박세은, 채정아
News.ts
import mongoose from "mongoose";
import { INews } from "../interfaces/INews";
const NewsSchema = new mongoose.Schema({
title_idx: {
type: Number,
required: true
},
title : {
type: String,
required: true
},
image: {
type: String,
required: true
},
event: {
type: String,
required: true
},
place: {
type: String,
required: true
},
info : {
type: String,
required: true
}
});
export default mongoose.model<INews & mongoose.Document>("News", NewsSchema);
INews.ts
export interface INews {
title_idx: Number;
title: string;
image: string;
event: string;
place: string;
info: string;
}
Recommend.ts
import mongoose from "mongoose";
import { IRecommend } from "../interfaces/IRecommend";
const RecommendSchema = new mongoose.Schema({
title_idx: {
type: Number,
required: true
},
title: {
type: String,
required: true
},
image: {
type: String,
required: true
},
review: {
type: Number,
required: true
},
customer: {
type: Number,
required: true
},
place: {
type: String,
required: true
},
bookmark: {
type: Boolean,
required: true
}
});
export default mongoose.model<IRecommend & mongoose.Document>("Recommend", RecommendSchema);
IRecommend.ts
export interface IRecommend {
title_idx: Number;
title: string;
image: string;
review: Number;
customer: Number;
place: string;
bookmark: Boolean;
}