-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] 커뮤니티 카테고리, 게시글 상세 조회 swagger 명세 (#331)
* [FEAT] community swagger schema 추가 * [FEAT] community category, post 조회 swagger 명세 * [DOCS]: .gitignore 내 .vscode 추가
- Loading branch information
Showing
9 changed files
with
128 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,7 @@ havit-server-key.cer | |
AuthKey_* | ||
|
||
# Swagger | ||
swagger-output.json | ||
swagger-output.json | ||
|
||
#VSCode | ||
.vscode |
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,9 @@ | ||
/** | ||
* @route GET /community/category | ||
* @desc 커뮤니티 카테고리 조회 | ||
* @access Public | ||
*/ | ||
|
||
module.exports = async (req, res) => { | ||
|
||
}; |
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,9 @@ | ||
/** | ||
* @route GET /community/posts/:communityPostId | ||
* @desc 커뮤니티 게시글 상세 조회 | ||
* @access Private | ||
*/ | ||
|
||
module.exports = async (req, res) => { | ||
|
||
}; |
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,39 @@ | ||
const express = require('express'); | ||
const router = express.Router(); | ||
const { checkUser } = require('../../../middlewares/auth'); | ||
|
||
router.get('/category', require('./communityCategoryGET') | ||
/** | ||
* #swagger.summary = "커뮤니티 카테고리 전체 조회" | ||
* #swagger.responses[200] = { | ||
description: "커뮤니티 카테고리 조회 성공", | ||
content: { | ||
"application/json": { | ||
schema:{ | ||
$ref: "#/components/schemas/responseCommunityCategorySchema" | ||
} | ||
} | ||
} | ||
} | ||
*/ | ||
); | ||
|
||
router.get('/posts/:communityPostId', checkUser, require('./communityPostGET') | ||
/** | ||
* #swagger.summary = "커뮤니티 게시글 상세 조회" | ||
* #swagger.responses[200] = { | ||
description: "커뮤니티 게시글 상세 조회 성공", | ||
content: { | ||
"application/json": { | ||
schema:{ | ||
$ref: "#/components/schemas/responseCommunityPostsDetailSchema" | ||
} | ||
} | ||
} | ||
} | ||
* #swagger.responses[400] | ||
* #swagger.responses[404] | ||
*/ | ||
); | ||
|
||
module.exports = 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
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,34 @@ | ||
const responseCommunityCategorySchema = { | ||
$status: 200, | ||
$success: true, | ||
$message: "커뮤니티 카테고리 조회 성공", | ||
$data: [ | ||
{ | ||
$id: 1, | ||
$name: "UI/UX" | ||
}, | ||
] | ||
}; | ||
|
||
const responseCommunityPostsDetailSchema = { | ||
$status: 200, | ||
$success: true, | ||
$message: "커뮤니티 게시글 상세 조회 성공", | ||
$data: { | ||
$id: 1, | ||
$nickname: "잡채", | ||
$profileImage: "https://s3~", | ||
$title: "제목", | ||
$body: "본문", | ||
$contentUrl: "https://naver.com", | ||
$contentTitle: "콘텐츠 링크 제목", | ||
$contentDescription: "콘텐츠 링크 설명", | ||
$thumbnailUrl: "https://content-thumbnail-image-url", | ||
$createdAt: "2024-02-01", | ||
}, | ||
} | ||
|
||
module.exports = { | ||
responseCommunityCategorySchema, | ||
responseCommunityPostsDetailSchema, | ||
}; |
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,5 @@ | ||
module.exports = { | ||
commonErrorSchema: require('./commonErrorSchema'), | ||
noticeSchema: require('./noticeSchema'), | ||
communitySchema: require('./communitySchema'), | ||
} |