Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 백엔드 개발 작업용 사전 작업 (#27, #28, #39) #40

Merged
merged 7 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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