Skip to content

Commit

Permalink
Merge pull request #2 from Today-s-ramen/youjung
Browse files Browse the repository at this point in the history
[ADD#1] 인터페이스, 스키마 정의 추가
  • Loading branch information
hujumee authored May 25, 2022
2 parents 7c7c38a + 5b831a0 commit 11a43b6
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/-feat-----0000------.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "[FEAT:#?] 0000 기능 구현"
about: 기능 구현 및 코드 수정 시 이슈를 생성합니다.
title: ''
labels: ''
assignees: ''

---

## What is this issue?

## Progress

- [x]
- [ ]
- [ ]

## Note
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 🌱관련 이슈
Related to:

## ❓리뷰 포인트
5 changes: 5 additions & 0 deletions src/interfaces/common/PostBaseResponseDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import mongoose from "mongoose";

export interface PostBaseResponseDto {
_id: mongoose.Schema.Types.ObjectId;
}
3 changes: 3 additions & 0 deletions src/interfaces/period/PeriodInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface PeriodInfo {
option: string;
}
3 changes: 3 additions & 0 deletions src/interfaces/quantity/QuantityInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface QuantityInfo {
option: string;
};
8 changes: 8 additions & 0 deletions src/interfaces/review/ReviewInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface ReviewInfo {
userName: String;
thumbnail?: String;
description: Text;
rates: Number;
packageName: string;
product: String;
}
7 changes: 7 additions & 0 deletions src/interfaces/subscribe/SubscribeInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { PeriodInfo } from "../period/PeriodInfo";
import { QuantityInfo } from "../quantity/QuantityInfo";

export interface SubscribeInfo {
period: PeriodInfo;
quantity: QuantityInfo;
};
11 changes: 11 additions & 0 deletions src/models/Period.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import mongoose from "mongoose";
import { PeriodInfo } from "../interfaces/period/PeriodInfo";

const PeriodSchema = new mongoose.Schema ({
option: {
type: String,
required: true
}
});

export default mongoose.model<PeriodInfo & mongoose.Document>("Period", PeriodSchema)
11 changes: 11 additions & 0 deletions src/models/Quantity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import mongoose from "mongoose";
import { QuantityInfo } from "../interfaces/quantity/QuantityInfo";

const QuantitySchema = new mongoose.Schema ({
option: {
type: String,
required: true
}
});

export default mongoose.model<QuantityInfo & mongoose.Document>("Queantity", QuantitySchema)
32 changes: 32 additions & 0 deletions src/models/Review.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import mongoose from "mongoose";
import { ReviewInfo } from "../interfaces/review/ReviewInfo";

const ReviewSchema = new mongoose.Schema ({
userName: {
type: String,
required: true
},
thumbnanil: {
type: String
},
description: {
type: String,
required: true
},
rates: {
type: Number,
required: true
},
packageName: {
type: String,
required: true
},
product: {
type: String,
required: true
}
},
{timestamps: true}
);

export default mongoose.model<ReviewInfo & mongoose.Document>("Review", ReviewSchema)
19 changes: 19 additions & 0 deletions src/models/Subscribe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import mongoose from "mongoose";
import { SubscribeInfo } from "../interfaces/subscribe/SubscribeInfo";

const SubscribeSchema = new mongoose.Schema ({
period: {
option: {
type: String,
required: true
}
},
quantity: {
option: {
type: String,
required: true
}
}
});

export default mongoose.model<SubscribeInfo & mongoose.Document>("Subscribe", SubscribeSchema)

0 comments on commit 11a43b6

Please sign in to comment.