Skip to content

Commit

Permalink
[BE] 백엔드 개발 작업용 사전 작업 (#27, #28, #39) (#40)
Browse files Browse the repository at this point in the history
* feat: 패키지 재정리, 테스트 제거

* feat: 엔티티 설계에 따른 도메인 구현

* feat: 공통 에러타입,에러,응답 구현

* feat: 컨트롤러 로깅 AOP 구현(#27)

* feat: 문서화 위한 Swagger 설정 구현(#39)

* feat: 컴파일 에러 부분 null 로 변경, TODO 마킹

* style: 메소드 간 개행 분리
  • Loading branch information
youngsu5582 authored Jul 18, 2024
1 parent 84a6ec8 commit 8cf1e7c
Show file tree
Hide file tree
Showing 36 changed files with 393 additions and 493 deletions.
66 changes: 0 additions & 66 deletions backend/src/main/java/corea/DataInitializer.java

This file was deleted.

67 changes: 0 additions & 67 deletions backend/src/main/java/corea/domain/Room.java

This file was deleted.

4 changes: 0 additions & 4 deletions backend/src/main/java/corea/dto/ApiResponse.java

This file was deleted.

39 changes: 0 additions & 39 deletions backend/src/main/java/corea/dto/RoomResponse.java

This file was deleted.

18 changes: 18 additions & 0 deletions backend/src/main/java/corea/exception/CoreaException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package corea.exception;

public class CoreaException extends Exception {
private final ExceptionType exceptionType;

public CoreaException(ExceptionType exceptionType) {
this.exceptionType = exceptionType;
}

public CoreaException(ExceptionType exceptionType, Throwable cause) {
super(cause);
this.exceptionType = exceptionType;
}

public ExceptionType getExceptionType() {
return exceptionType;
}
}
4 changes: 4 additions & 0 deletions backend/src/main/java/corea/exception/ErrorResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package corea.exception;

public record ErrorResponse(String message) {
}
20 changes: 20 additions & 0 deletions backend/src/main/java/corea/exception/ExceptionType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package corea.exception;

import org.springframework.http.HttpStatus;

public enum ExceptionType {
SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR,"서버에 문제가 발생했습니다.");
private final HttpStatus httpStatus;
private final String message;

ExceptionType(final HttpStatus httpStatus, final String message) {
this.httpStatus = httpStatus;
this.message = message;
}
public HttpStatus getHttpStatus() {
return httpStatus;
}
public String getMessage() {
return message;
}
}
Loading

0 comments on commit 8cf1e7c

Please sign in to comment.