-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyejung #7
Merged
Hyejung #7
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
416e302
[CHORE#4] ์ฝ๋ ์ปจ๋ฒค์
์ ์ฉ
hyejungg c1ef0f8
[ADD:#3] ์ฝ๋ ์คํ ์ ๋น ์ปฌ๋ ์
์์ฑํ๋๋ก ์ฝ๋ ์ถ๊ฐ
hyejungg cb348af
[CHORE:#3] ๋ฆฌ๋ทฐ ์ค ์ํ ์ ๋ณด ๋ฐฐ์ด ํํ๋ก ๋ณ๊ฒฝ ๋ฐ ์คํ ์์
hyejungg 006fe12
[CHORE:#3] Quantity ์ปฌ๋ ์
๋ช
์คํ ์์
hyejungg a85cd0a
[FEAT:#3] ๋ฉ์ธ ํ์ด์ง ์กฐํ ๊ธฐ๋ฅ ๊ตฌํ
hyejungg 7ebbd7a
[CHORE:#3] interface์์ ๋น ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก ๋ณ๊ฒฝ
hyejungg 874bc43
[FEAT:#5] ๋ผ๋ฉด ๊ตฌ๋
์ ์ต์
๋ด์ฉ ์กฐํ ๊ธฐ๋ฅ ๊ตฌํ
hyejungg f687a93
[FEAT:#6] ๋ฆฌ๋ทฐ ๋ฑ๋ก ๊ธฐ๋ฅ ๊ตฌํ
hyejungg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Request, Response } from 'express'; | ||
import message from '../modules/responseMessage'; | ||
import statusCode from '../modules/statusCode'; | ||
import util from '../modules/util'; | ||
import SubscribeService from '../services/SubscribeService'; | ||
|
||
const getSubscribeOptions = async (req: Request, res: Response) => { | ||
try { | ||
const data = await SubscribeService.getSubscribeOptions(); | ||
if (!data) { | ||
res.status(statusCode.NOT_FOUND).send(util.fail(statusCode.NOT_FOUND, message.NOT_FOUND)); | ||
} | ||
res.status(statusCode.OK).send(util.success(statusCode.OK, message.READ_SUBSCRIBE_OPTION_SUCCESS, data)); | ||
} catch (error) { | ||
console.log(error); | ||
res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, message.INTERNAL_SERVER_ERROR)); | ||
} | ||
}; | ||
|
||
export default { getSubscribeOptions }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import ReviewController from './ReviewController'; | ||
import SubscribeController from './SubscribeController'; | ||
|
||
// controller index file | ||
export { ReviewController }; | ||
export { ReviewController, SubscribeController }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SubscribeOptionDto { | ||
deliveryPeriodOptions: PeriodInfo[]; | ||
deliveryQuantityOptions: QuantityInfo[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Router } from 'express'; | ||
import { SubscribeController } from '../controllers'; | ||
|
||
const router: Router = Router(); | ||
|
||
router.get('/', SubscribeController.getSubscribeOptions); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// router index file | ||
import { Router } from 'express'; | ||
import ReviewRouter from './ReviewRouter'; | ||
import SubScribeRouter from './SubscribeRouter'; | ||
|
||
const router: Router = Router(); | ||
|
||
router.use('/review', ReviewRouter); | ||
router.use('/subscribe', SubScribeRouter); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { SubscribeOptionDto } from '../interfaces/subscribe/SubscribeOptionDto'; | ||
import Period from '../models/Period'; | ||
import Quantity from '../models/Quantity'; | ||
|
||
const getSubscribeOptions = async (): Promise<SubscribeOptionDto | null> => { | ||
try { | ||
const periodOptions = await Period.find(); | ||
const quantityOptions = await Quantity.find(); | ||
|
||
if (!periodOptions || !quantityOptions) { | ||
return null; | ||
} | ||
|
||
const subscribeOptionList = { | ||
deliveryPeriodOptions: periodOptions, | ||
deliveryQuantityOptions: quantityOptions, | ||
}; | ||
|
||
return subscribeOptionList; | ||
} catch (error) { | ||
console.log(error); | ||
throw error; | ||
} | ||
}; | ||
|
||
export default { getSubscribeOptions }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ฌ ๋ก์ง ์ฒ๋ฆฌ ์ข์์