-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from Scents-Note/dev
dev -> main
- Loading branch information
Showing
55 changed files
with
1,841 additions
and
1,583 deletions.
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
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
'use strict'; | ||
|
||
import KeywordService from '../service/KeywordService'; | ||
import { DEFAULT_PAGE_SIZE } from '@src/utils/constants'; | ||
import StatusCode from '../utils/statusCode'; | ||
import { NextFunction, Request, Response } from 'express'; | ||
|
||
const Keyword = new KeywordService(); | ||
|
||
export const getKeywordAll = async ( | ||
req: Request, | ||
res: Response, | ||
next: NextFunction | ||
) => { | ||
const pagingIndex = parseInt(req.query.pagingIndex?.toString() ?? '1'); | ||
const pagingSize = parseInt( | ||
req.query.pagingSize?.toString() ?? `${DEFAULT_PAGE_SIZE}` | ||
); | ||
try { | ||
const response = await Keyword.getKeywordAll(pagingIndex, pagingSize); | ||
res.status(StatusCode.OK).json({ | ||
message: '키워드 목록 전체 조회 성공', | ||
data: response, | ||
}); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}; | ||
|
||
export const getKeywordOfPerfume = async ( | ||
req: Request, | ||
res: Response, | ||
next: NextFunction | ||
) => { | ||
const perfumeIdx = parseInt(req.params['perfumeIdx']); | ||
try { | ||
const response = await Keyword.getKeywordOfPerfume(perfumeIdx); | ||
res.status(StatusCode.OK).json({ | ||
message: '향수별 키워드 전체 조회 성공', | ||
data: response, | ||
}); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}; |
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
Oops, something went wrong.