Skip to content

Commit 6b71322

Browse files
authored
Merge: Doc rename search swagger 수정
Docs: Doc rename search swagger 수정
2 parents 8f03ac5 + 11e8984 commit 6b71322

File tree

3 files changed

+76
-14
lines changed

3 files changed

+76
-14
lines changed

src/main/java/io/ejangs/docsa/domain/commit/app/CommitContentAssembler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class CommitContentAssembler {
2525

2626
public List<Map<String, Object>> assemble(String commitMongoId) {
2727
CommitBlockSequence blockSeq = commitBlockSequenceRepository.findById(commitMongoId)
28-
.orElseThrow(() -> new CustomException(CommitErrorCode.MONGO_COMMIT_NOT_FOUND));
28+
.orElseThrow(() -> new CustomException(CommitErrorCode.COMMIT_NOT_FOUND));
2929

3030
List<String> blockIds = blockSeq.getBlockOrders();
3131

@@ -35,7 +35,7 @@ public List<Map<String, Object>> assemble(String commitMongoId) {
3535

3636
return blockIds.stream()
3737
.map(id -> Optional.ofNullable(blockMap.get(id))
38-
.orElseThrow(() -> new CustomException(BlockErrorCode.MONGO_BLOCK_NOT_FOUND)))
38+
.orElseThrow(() -> new CustomException(CommitErrorCode.COMMIT_NOT_FOUND)))
3939
.map(Block::getContent)
4040
.toList();
4141
}

src/main/java/io/ejangs/docsa/domain/doc/swagger/RenameDocDocs.java

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,11 @@
6464
),
6565
@ApiResponse(
6666
responseCode = "400",
67-
description = "유효하지 않은 문서 제목 요청 및 존재하지 않는 문서",
67+
description = "유효하지 않은 문서 제목 요청",
6868
content = @Content(
6969
schema = @Schema(implementation = ErrorResponse.class),
7070
mediaType = MediaType.APPLICATION_JSON_VALUE,
7171
examples = {
72-
@ExampleObject(
73-
name = "존재하지 않는 문서 ID",
74-
value = """
75-
{
76-
"status": 400,
77-
"message": "해당 문서를 찾을 수 없습니다.",
78-
"error": "DOCUMENT_NOT_FOUND"
79-
}
80-
"""
81-
),
8272
@ExampleObject(
8373
name = "이미 존재하는 문서 제목",
8474
value = """
@@ -110,7 +100,7 @@
110100
"""
111101
),
112102
@ExampleObject(
113-
name = "현재 문서의 제목과 같은 제목으로 수정요청",
103+
name = "현재 문서의 제목과 같은 제목으로 수정 요청",
114104
value = """
115105
{
116106
"status": 400,
@@ -140,6 +130,42 @@
140130
)
141131
)
142132
),
133+
@ApiResponse(
134+
responseCode = "404",
135+
description = "문서 이름 수정 실패 - 존재하지 않는 문서",
136+
content = @Content(
137+
schema = @Schema(implementation = ErrorResponse.class),
138+
mediaType = MediaType.APPLICATION_JSON_VALUE,
139+
examples = @ExampleObject(
140+
value = """
141+
{
142+
"status": 404,
143+
"message": "해당 문서를 찾을 수 없습니다.",
144+
"error": "DOCUMENT_NOT_FOUND"
145+
}
146+
"""
147+
)
148+
)
149+
),
150+
@ApiResponse(
151+
responseCode = "500",
152+
description = "문서 이름 수정 실패 - MySQL 또는 MongoDB 접근 실패",
153+
content = @Content(
154+
schema = @Schema(implementation = ErrorResponse.class),
155+
mediaType = MediaType.APPLICATION_JSON_VALUE,
156+
examples = {
157+
@ExampleObject(
158+
value = """
159+
{
160+
"status": 500,
161+
"message": "데이터 처리 중 오류가 발생했습니다. 잠시 후 다시 시도해주세요.",
162+
"error": "DATABASE_ERROR"
163+
}
164+
"""
165+
)
166+
}
167+
)
168+
)
143169
}
144170
)
145171
public @interface RenameDocDocs {

src/main/java/io/ejangs/docsa/domain/doc/swagger/SearchDocDocs.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,42 @@
195195
"""
196196
)
197197
)
198+
),
199+
@ApiResponse(
200+
responseCode = "404",
201+
description = "문서 검색 실패 - 존재하지 않는 커밋",
202+
content = @Content(
203+
schema = @Schema(implementation = ErrorResponse.class),
204+
mediaType = MediaType.APPLICATION_JSON_VALUE,
205+
examples = @ExampleObject(
206+
value = """
207+
{
208+
"status": 404,
209+
"message": "해당 기록을 찾을 수 없습니다.",
210+
"error": "COMMIT_NOT_FOUND"
211+
}
212+
"""
213+
)
214+
)
215+
),
216+
@ApiResponse(
217+
responseCode = "500",
218+
description = "문서 검색 실패 - MySQL 또는 MongoDB 접근 실패",
219+
content = @Content(
220+
schema = @Schema(implementation = ErrorResponse.class),
221+
mediaType = MediaType.APPLICATION_JSON_VALUE,
222+
examples = {
223+
@ExampleObject(
224+
value = """
225+
{
226+
"status": 500,
227+
"message": "데이터 처리 중 오류가 발생했습니다. 잠시 후 다시 시도해주세요.",
228+
"error": "DATABASE_ERROR"
229+
}
230+
"""
231+
)
232+
}
233+
)
198234
)
199235
}
200236
)

0 commit comments

Comments
 (0)