Skip to content

Commit b637559

Browse files
committed
fix: Swagger 응답 스키마 통일
1 parent eac8281 commit b637559

File tree

13 files changed

+49
-476
lines changed

13 files changed

+49
-476
lines changed

src/main/java/com/climbup/climbup/attempt/controller/AttemptController.java

Lines changed: 6 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -42,66 +42,7 @@ public class AttemptController {
4242

4343

4444
@Operation(summary = "도전한 루트미션과 비슷한 난이도의 루트미션 리스트 불러오기", description = "도전한 루트미션과 비슷한 난이도의 루트미션 리스트를 받아보기", security = @SecurityRequirement(name = "bearerAuth"))
45-
@ApiResponses({
46-
@ApiResponse(
47-
responseCode = "200",
48-
description = "유저 추천 루트미션 리스트 반환",
49-
content = @Content(
50-
mediaType = "application/json",
51-
examples = @ExampleObject(
52-
name = "성공적인 추천 루트미션 리스트 응답",
53-
value = """
54-
{
55-
"message": "추천 루트미션 리스트를 성공적으로 조회했습니다.",
56-
"data": [
57-
{
58-
"missionId": 1,
59-
"gymId": 1,
60-
"attempts": [
61-
{
62-
"missionAttemptId": 1,
63-
"success": true,
64-
"videoUrl": "https://example.com/attempt1.mp4",
65-
"createdAt": "2025-07-31T14:20:00"
66-
}
67-
],
68-
"sector": {
69-
"id": 1,
70-
"name": "A 섹터",
71-
"imageUrl": "https://example.com/sector1.jpg"
72-
},
73-
"difficulty": "V3",
74-
"score": 100,
75-
"imageUrl": "https://example.com/mission1.jpg",
76-
"videoUrl": "https://example.com/mission1.mp4",
77-
"removedAt": "2025-07-31T14:20:00",
78-
"postedAt": "2025-07-31T14:20:00",
79-
"recommendedOrder": 1
80-
},
81-
{
82-
"missionId": 2,
83-
"gymId": 1,
84-
"attempts": [],
85-
"sector": {
86-
"id": 2,
87-
"name": "B 섹터",
88-
"imageUrl": "https://example.com/sector2.jpg"
89-
},
90-
"difficulty": "V4",
91-
"score": 150,
92-
"imageUrl": "https://example.com/mission2.jpg",
93-
"videoUrl": "https://example.com/mission2.mp4",
94-
"removedAt": "2025-07-31T14:20:00",
95-
"postedAt": "2025-07-31T14:20:00",
96-
"recommendedOrder": 2
97-
}
98-
]
99-
}
100-
"""
101-
)
102-
)
103-
)
104-
})
45+
@ApiResponse(responseCode = "200", description = "유저 추천 루트미션 리스트 반환")
10546
@GetMapping("/{attemptId}/recommendations")
10647
public ResponseEntity<ApiResult<List<RouteMissionRecommendationResponse>>> getRouteMissionRecommendationByAttempt(
10748
@PathVariable(name = "attemptId") Long attemptId
@@ -111,29 +52,7 @@ public ResponseEntity<ApiResult<List<RouteMissionRecommendationResponse>>> getRo
11152

11253
@Operation(summary = "루트미션 도전기록 등록", description = "루트미션에 대한 도전기록을 등록합니다. 성공 시 SR이 증가합니다.", security = @SecurityRequirement(name = "bearerAuth"))
11354
@ApiResponses({
114-
@ApiResponse(
115-
responseCode = "201",
116-
description = "도전기록이 성공적으로 등록됨",
117-
content = @Content(
118-
mediaType = "application/json",
119-
examples = @ExampleObject(
120-
name = "성공적인 도전기록 등록 응답",
121-
value = """
122-
{
123-
"message": "도전기록이 성공적으로 등록되었습니다.",
124-
"data": {
125-
"missionAttemptId": 1,
126-
"success": true,
127-
"videoUrl": null,
128-
"createdAt": "2025-07-31T14:20:00",
129-
"srGained": 125,
130-
"currentSr": 1375
131-
}
132-
}
133-
"""
134-
)
135-
)
136-
),
55+
@ApiResponse(responseCode = "201", description = "도전기록이 성공적으로 등록됨"),
13756
@ApiResponse(
13857
responseCode = "400",
13958
description = "유효하지 않은 난이도",
@@ -196,33 +115,7 @@ public ResponseEntity<ApiResult<CreateAttemptResponse>> createAttempt(
196115
}
197116

198117
@Operation(summary = "해당 도전의 영상 업로드 상태 불러오기", description = "해당 도전의 영상 업로드 상태 불러오기", security = @SecurityRequirement(name = "bearerAuth"))
199-
@ApiResponses({
200-
@ApiResponse(
201-
responseCode = "200",
202-
description = "해당 도전의 영상 업로드 상태 불러오기",
203-
content = @Content(
204-
mediaType = "application/json",
205-
examples = @ExampleObject(
206-
name = "성공적인 도전 영상 업로드 상태 반환",
207-
value = """
208-
{
209-
"message": "도전의 영상 업로드 상태를 성공적으로 조회했습니다.",
210-
"data": {
211-
"status": "in_progress",
212-
"uploadId": "8ded5806-87df-43b5-9c64-e4513eb33987",
213-
"createdAt": "2025-07-31T14:20:00",
214-
"chunks": {
215-
"totalReceived": 505050,
216-
"totalExpected": 10101010,
217-
"completedChunks": [1, 2, 3, 4, 5, 6, 7, 10]
218-
}
219-
}
220-
}
221-
"""
222-
)
223-
)
224-
)
225-
})
118+
@ApiResponse(responseCode = "200", description = "해당 도전의 영상 업로드 상태 불러오기")
226119
@GetMapping("/{attemptId}/upload/status")
227120
public ResponseEntity<ApiResult<RouteMissionUploadStatusResponse>> getRouteMissionUploadStatus(
228121
@PathVariable(name = "attemptId") Long attemptId
@@ -232,26 +125,7 @@ public ResponseEntity<ApiResult<RouteMissionUploadStatusResponse>> getRouteMissi
232125

233126

234127
@Operation(summary = "해당 도전의 영상 업로드 세션 생성하기", description = "해당 도전의 영상 업로드 세션 생성하기", security = @SecurityRequirement(name = "bearerAuth"))
235-
@ApiResponses({
236-
@ApiResponse(
237-
responseCode = "201",
238-
description = "해당 도전의 영상 업로드 세션 생성하기",
239-
content = @Content(
240-
mediaType = "application/json",
241-
examples = @ExampleObject(
242-
name = "성공적인 도전 영상 업로드 세션 생성",
243-
value = """
244-
{
245-
"message": "영상 업로드 세션을 성공적으로 생성했습니다.",
246-
"data": {
247-
"uploadId": "8ded5806-87df-43b5-9c64-e4513eb33987"
248-
}
249-
}
250-
"""
251-
)
252-
)
253-
)
254-
})
128+
@ApiResponse(responseCode = "201", description = "해당 도전의 영상 업로드 세션 생성하기")
255129
@PostMapping("/{attemptId}/upload/initialize")
256130
public ResponseEntity<ApiResult<RouteMissionUploadSessionInitializeResponse>> initializeRouteMissionUploadSession(
257131
@PathVariable(name = "attemptId") Long attemptId,
@@ -262,28 +136,7 @@ public ResponseEntity<ApiResult<RouteMissionUploadSessionInitializeResponse>> in
262136

263137

264138
@Operation(summary = "해당 도전의 영상 청크 업로드", description = "해당 도전의 영상 청크 업로드", security = @SecurityRequirement(name = "bearerAuth"))
265-
@ApiResponses({
266-
@ApiResponse(
267-
responseCode = "201",
268-
description = "해당 도전의 영상 청크 업로드하기",
269-
content = @Content(
270-
mediaType = "application/json",
271-
examples = @ExampleObject(
272-
name = "성공적인 도전 영상 청크 업로드",
273-
value = """
274-
{
275-
"message": "영상 청크를 성공적으로 업로드했습니다.",
276-
"data": {
277-
"index": 5,
278-
"totalChunkReceived": 5,
279-
"totalChunkExpected": 20
280-
}
281-
}
282-
"""
283-
)
284-
)
285-
)
286-
})
139+
@ApiResponse(responseCode = "201", description = "해당 도전의 영상 청크 업로드하기")
287140
@PostMapping("/{attemptId}/upload/{uploadId}/chunk")
288141
public ResponseEntity<ApiResult<RouteMissionUploadChunkResponse>> uploadRouteMissionVideoChunk(
289142
@PathVariable(name = "attemptId") Long attemptId,
@@ -295,26 +148,7 @@ public ResponseEntity<ApiResult<RouteMissionUploadChunkResponse>> uploadRouteMis
295148

296149

297150
@Operation(summary = "해당 도전의 영상 업로드 세션 마무리", description = "해당 도전의 영상 업로드 세션 마무리", security = @SecurityRequirement(name = "bearerAuth"))
298-
@ApiResponses({
299-
@ApiResponse(
300-
responseCode = "201",
301-
description = "해당 도전의 영상 업로드 세션 마무리",
302-
content = @Content(
303-
mediaType = "application/json",
304-
examples = @ExampleObject(
305-
name = "성공적인 도전 영상 업로드 세션 마무리",
306-
value = """
307-
{
308-
"message": "영상 업로드 세션을 성공적으로 마무리했습니다.",
309-
"data": {
310-
"fileName": "thisIsFileName"
311-
}
312-
}
313-
"""
314-
)
315-
)
316-
)
317-
})
151+
@ApiResponse(responseCode = "201", description = "해당 도전의 영상 업로드 세션 마무리")
318152
@PostMapping("/{attemptId}/upload/{uploadId}/finalize")
319153
public ResponseEntity<ApiResult<RouteMissionUploadSessionFinalizeResponse>> finalizeRouteMissionUploadSession(
320154
@PathVariable(name = "attemptId") Long attemptId,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
package com.climbup.climbup.attempt.upload.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import lombok.Builder;
45
import lombok.Data;
56

67
@Data
78
@Builder
9+
@Schema(description = "루트미션 도전 영상 업로드 응답")
810
public class RouteMissionUploadChunkResponse {
11+
12+
@Schema(description = "인덱스 번호", example = "5")
913
private Integer index;
14+
15+
@Schema(description = "현재까지 업로드된 갯수", example = "5")
1016
private Integer totalChunkReceived;
17+
18+
@Schema(description = "총 업로드될 갯수", example = "20")
1119
private Integer totalChunkExpected;
1220
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package com.climbup.climbup.attempt.upload.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import lombok.Builder;
45
import lombok.Data;
56

67
@Data
78
@Builder
9+
@Schema(description = "영상 업로드 세션 완료 응답")
810
public class RouteMissionUploadSessionFinalizeResponse {
11+
12+
@Schema(description = "파일명", example = "thisIsFileName")
913
private String fileName;
1014
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package com.climbup.climbup.attempt.upload.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import lombok.Builder;
45
import lombok.Data;
56

67
@Data
78
@Builder
9+
@Schema(description = "영상 업로드 세션 생성 응답")
810
public class RouteMissionUploadSessionInitializeResponse {
11+
12+
@Schema(description = "업로드 ID", example = "8ded5806-87df-43b5-9c64-e4513eb33987")
913
private String uploadId;
1014
}

src/main/java/com/climbup/climbup/attempt/upload/dto/response/RouteMissionUploadStatusResponse.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.climbup.climbup.attempt.upload.dto.response;
22

33
import com.climbup.climbup.attempt.upload.enums.UploadStatus;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.Builder;
56
import lombok.Data;
67

@@ -9,12 +10,18 @@
910

1011
@Data
1112
@Builder
13+
@Schema(description = "영상 업로드 상태 응답")
1214
public class RouteMissionUploadStatusResponse {
15+
16+
@Schema(description = "업로드 상태", example = "in_progress")
1317
private UploadStatus status;
1418

19+
@Schema(description = "업로드 ID", example = "8ded5806-87df-43b5-9c64-e4513eb33987")
1520
private String uploadId;
1621

22+
@Schema(description = "생성 시각", example = "2025-07-31T14:20:00")
1723
private LocalDateTime createdAt;
1824

25+
@Schema(description = "청크 목록")
1926
private UploadStatusChunkResponse chunks;
2027
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
package com.climbup.climbup.attempt.upload.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import lombok.Data;
45

56
import java.util.List;
67

78
@Data
9+
@Schema(description = "영상 청크별 업로드 상태 응답")
810
public class UploadStatusChunkResponse {
11+
12+
@Schema(description = "현재까지 업로드된 갯수", example = "505050")
913
private Integer totalReceived;
1014

15+
@Schema(description = "총 업로드될 갯수", example = "10101010")
1116
private Integer totalExpected;
1217

18+
@Schema(description = "현재까지 업로드된 청크 ID 목록", example = "[1, 2, 3, 4, 5, 6, 7, 10]")
1319
private List<Integer> completedChunks;
1420
}

src/main/java/com/climbup/climbup/auth/controller/TokenController.java

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,7 @@ public class TokenController {
3434

3535
@Operation(summary = "토큰 재발급", description = "Refresh Token으로 새로운 Access Token을 발급받습니다")
3636
@ApiResponses({
37-
@ApiResponse(
38-
responseCode = "200",
39-
description = "토큰 재발급 성공",
40-
content = @Content(
41-
mediaType = "application/json",
42-
examples = @ExampleObject(
43-
value = """
44-
{
45-
"message": "토큰이 성공적으로 재발급되었습니다.",
46-
"data": {
47-
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
48-
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
49-
"tokenType": "Bearer",
50-
"accessTokenExpiresIn": 3600,
51-
"refreshTokenExpiresIn": 604800
52-
}
53-
}
54-
"""
55-
)
56-
)
57-
),
37+
@ApiResponse(responseCode = "200", description = "토큰 재발급 성공"),
5838
@ApiResponse(
5939
responseCode = "400",
6040
description = "잘못된 요청",
@@ -117,21 +97,7 @@ public ResponseEntity<ApiResult<TokenResponse>> refreshToken(@RequestBody Map<St
11797

11898
@Operation(summary = "로그아웃", description = "Refresh Token을 무효화합니다")
11999
@ApiResponses({
120-
@ApiResponse(
121-
responseCode = "200",
122-
description = "로그아웃 성공",
123-
content = @Content(
124-
mediaType = "application/json",
125-
examples = @ExampleObject(
126-
value = """
127-
{
128-
"message": "로그아웃이 완료되었습니다.",
129-
"data": null
130-
}
131-
"""
132-
)
133-
)
134-
),
100+
@ApiResponse(responseCode = "200", description = "로그아웃 성공"),
135101
@ApiResponse(
136102
responseCode = "403",
137103
description = "접근 권한 없음",

src/main/java/com/climbup/climbup/level/controller/LevelController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.climbup.climbup.level.service.LevelService;
66
import io.swagger.v3.oas.annotations.Operation;
77
import io.swagger.v3.oas.annotations.Parameter;
8+
import io.swagger.v3.oas.annotations.media.Schema;
89
import io.swagger.v3.oas.annotations.responses.ApiResponse;
910
import io.swagger.v3.oas.annotations.tags.Tag;
1011
import lombok.RequiredArgsConstructor;

0 commit comments

Comments
 (0)