From 9f275ba2c591ae596749b0bba26cad5f870953d2 Mon Sep 17 00:00:00 2001 From: sua kang Date: Fri, 16 Feb 2024 17:52:38 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80?= =?UTF-8?q?=20=EC=95=8A=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ChatController.java | 1 - .../util/constant/ErrorCode.java | 32 ------------------- .../util/exception/CustomAPIException.java | 22 ------------- 3 files changed, 55 deletions(-) delete mode 100644 src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java delete mode 100644 src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java diff --git a/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java b/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java index e3edbd69..299ce772 100644 --- a/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java +++ b/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java @@ -8,7 +8,6 @@ import chattingserver.service.ChatMessageService; import chattingserver.service.RoomService; //import chattingserver.util.constant.ErrorCode; -import chattingserver.util.exception.CustomAPIException; import com.lalala.exception.BusinessException; import com.lalala.exception.ErrorCode; import com.lalala.response.BaseResponse; diff --git a/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java b/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java deleted file mode 100644 index 5416560d..00000000 --- a/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java +++ /dev/null @@ -1,32 +0,0 @@ -package chattingserver.util.constant; - -import chattingserver.dto.response.CommonAPIError; -import lombok.Getter; - -import java.time.LocalDateTime; - -@Getter -public enum ErrorCode { - ROOM_NOT_FOUND_ERROR(4003, "CHATTING-001", "id에 해당하는 채팅방이 없습니다."); - - private final int status; - private final String code; - private final String description; - - ErrorCode(int status, String code, String description) { - this.status = status; - this.code = code; - this.description = description; - } - - public CommonAPIError toErrorResponseDto(String msg) { - return CommonAPIError - .builder() - .status(this.status) - .errorCode(this.code) - .description(this.description) - .errorMsg(msg) - .timestamp(LocalDateTime.now()) - .build(); - } -} diff --git a/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java b/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java deleted file mode 100644 index eeebffd8..00000000 --- a/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java +++ /dev/null @@ -1,22 +0,0 @@ -package chattingserver.util.exception; - -import chattingserver.util.constant.ErrorCode; -import lombok.Getter; - -@Getter -public class CustomAPIException extends RuntimeException{ - - private static final long serialVersionUID = 1L; - - private final String description; - private final String code; - private final int status; - private String errorMsg; - - public CustomAPIException(ErrorCode errorCode, String errorMsg){ - this.description = errorCode.getDescription(); - this.status = errorCode.getStatus(); - this.code = errorCode.getCode(); - this.errorMsg = errorMsg; - } -} \ No newline at end of file