Skip to content

Be-Daangn/server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOPT 클라이언트 서버 합동 세미나 - 당근 마켓

개발

박세은, 채정아

API 명세서

Model - News 소식 글

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

Interface - INews

INews.ts
export interface INews {
    title_idx: Number;
    title: string;
    image: string;
    event: string;
    place: string;
    info: string;
}   

Model - Recommend 추천 글

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

Interface - IRecommend

IRecommend.ts
export interface IRecommend {
    title_idx: Number;
    title: string;
    image: string;
    review: Number;
    customer: Number;
    place: string;
    bookmark: Boolean;
}

Releases

No releases published

Packages

No packages published