Skip to content

Commit 10fba30

Browse files
committed
CLAP-193 Feat: 에러 응답 controller 구현 및 dev용 명시
<footer> - 관련: #190
1 parent 4a5b94d commit 10fba30

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package clap.server.adapter.inbound.web.example;
2+
3+
import clap.server.common.annotation.architecture.WebAdapter;
4+
import clap.server.common.annotation.swagger.ApiErrorCodes;
5+
import clap.server.common.annotation.swagger.DevelopOnlyApi;
6+
import clap.server.exception.code.*;
7+
import io.swagger.v3.oas.annotations.Operation;
8+
import io.swagger.v3.oas.annotations.tags.Tag;
9+
import org.springframework.web.bind.annotation.GetMapping;
10+
import org.springframework.web.bind.annotation.RequestMapping;
11+
12+
@Tag(name = "*. 에러 응답")
13+
@WebAdapter
14+
@RequestMapping("/api/examples")
15+
public class ErrorExampleController {
16+
17+
@GetMapping("/global")
18+
@DevelopOnlyApi
19+
@Operation(summary = "글로벌 (aop, 서버 내부 오류등) 관련 에러 코드 나열")
20+
@ApiErrorCodes(GlobalErrorCode.class)
21+
public void getGlobalErrorCode() {}
22+
23+
@GetMapping("/member")
24+
@DevelopOnlyApi
25+
@Operation(summary = "회원 도메인 관련 에러 코드 나열")
26+
@ApiErrorCodes(MemberErrorCode.class)
27+
public void getMemberErrorCode() {}
28+
29+
@GetMapping("/auth")
30+
@DevelopOnlyApi
31+
@Operation(summary = "인증 및 인가 관련 에러 코드 나열")
32+
@ApiErrorCodes(MemberErrorCode.class)
33+
public void getAuthErrorCode() {}
34+
35+
@GetMapping("/task")
36+
@DevelopOnlyApi
37+
@Operation(summary = "작업 도메인 관련 에러 코드 나열")
38+
@ApiErrorCodes(TaskErrorCode.class)
39+
public void getTaskErrorCode() {}
40+
41+
@GetMapping("/notification")
42+
@DevelopOnlyApi
43+
@Operation(summary = "알림 도메인 및 웹훅 관련 에러 코드 나열")
44+
@ApiErrorCodes(TaskErrorCode.class)
45+
public void getNotificationErrorCode() {}
46+
47+
@GetMapping("/comment")
48+
@DevelopOnlyApi
49+
@Operation(summary = "댓글 도메인 관련 에러 코드 나열")
50+
@ApiErrorCodes(CommentErrorCode.class)
51+
public void getCommentErrorCode() {}
52+
53+
@GetMapping("/statistic")
54+
@DevelopOnlyApi
55+
@Operation(summary = "작업 통계 관련 에러 코드 나열")
56+
@ApiErrorCodes(LabelErrorCode.class)
57+
public void getStatisticsErrorCode() {}
58+
59+
@GetMapping("/label")
60+
@DevelopOnlyApi
61+
@Operation(summary = "라벨 도메인 관련 에러 코드 나열")
62+
@ApiErrorCodes(LabelErrorCode.class)
63+
public void getLabelErrorCode() {}
64+
65+
@GetMapping("/department")
66+
@DevelopOnlyApi
67+
@Operation(summary = "부서 도메인 관련 에러 코드 나열")
68+
@ApiErrorCodes(DepartmentErrorCode.class)
69+
public void getDepartmentErrorCode() {}
70+
71+
@GetMapping("/file")
72+
@DevelopOnlyApi
73+
@Operation(summary = "파일 처리 관련 에러 코드 나열")
74+
@ApiErrorCodes(FileErrorcode.class)
75+
public void getFileErrorCode() {}
76+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package clap.server.common.annotation.swagger;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Target({ElementType.METHOD})
9+
@Retention(RetentionPolicy.RUNTIME)
10+
public @interface DevelopOnlyApi {}

0 commit comments

Comments
 (0)