From 8cbbf875b1446052331ac25af1f7f81910d33c6d Mon Sep 17 00:00:00 2001 From: Youjung Heo Date: Fri, 22 Jul 2022 00:29:46 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20=EB=8B=A4=EC=8B=9C=20=EB=93=A4?= =?UTF-8?q?=EC=9D=80=20=EA=B3=A1=20=EB=AE=A4=EB=A9=98=ED=8A=B8=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=84=B1=EA=B3=B5=20#51?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/MumentController.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/controllers/MumentController.ts b/src/controllers/MumentController.ts index 2e54bbc..8119ad0 100644 --- a/src/controllers/MumentController.ts +++ b/src/controllers/MumentController.ts @@ -281,6 +281,25 @@ const getBanner = async (req: Request, res: Response) => { } }; +/** + * @ROUTE GET mument/again + * @DESC get today's again tagged mument list + */ +const getAgainMument = async (req: Request, res: Response) => { + try { + const data = await MumentService.getAgainMument(); + + if (data === constant.NO_HOME_CONTENT) { + res.status(statusCode.NO_CONTENT).send(util.success(statusCode.NO_CONTENT, message.GET_AGAIN_MUMENT_SUCCESS)); + } + + res.status(statusCode.OK).send(util.success(statusCode.OK, message.GET_AGAIN_MUMENT_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 { createMument, updateMument, @@ -293,4 +312,5 @@ export default { getRandomMument, getTodayMument, getBanner, + getAgainMument, };