-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [feat] 유효하지 않은 가게 생성시 발생하는 커스텀 예외 * [feat] 가게 카테고리를 찾지 못할 때 발생하는 커스텀 예외 * [feat] 가게 관련 에러 코드 Enum 정의 에러 코드는 클라이언트에게 보여지는 부분이다. * [feat] 사용하지 않는 StoreException 제거 코드 스타일 통일에 따라 해당 예외는 제거함 * [refactor] 가게 카테고리를 찾지 못할 때, NotFoundStoreCategoryException 을 던지도록 수정 * [refactor] 가게 Store 객체를 생성하지 못할 때, InvalidStoreCreationException 를 던지도록 수정 * [test] 커스텀 예외 변경에 따라, 테스트 코드 수정 및 테스트 * [style] 서비스 메서드에서 발생할 수 있는 런타임 예외 javadocs 주석 추가 * [refactor] 컨트롤러/서비스 계층 코드 스타일 통일 1. 컨트롤러 계층 - xxxRequest 1. 서비스 계층 - xxxCommand 2. 변경함에 따라 서비스 계층에서 Vendor 를 조회하는 로직이 추가됨 * [test] 컨트롤러/서비스 계층 코드 스타일 변경에 따라 테스트 코드 수정 및 테스트 * [style] 가게 등록 서비스 계층에서 발생할 수 있는 RuntimeException javadocs 명시 * [refactor] MenuLineItem DTO를 외부 클래스로 분리 Request, Command DTO로 분리하는 과정에서 MenuLineItem 을 외부 클래스로 분리함 * [refactor] 서비스 계층 코드 스타일 통일 1. 서비스 계층 - xxxCommand 2. 변경함에 따라 서비스 계층에서 Vendor 를 조회하는 로직이 추가됨 * [test] 서비스 계층 코드 스타일 변경에 따라 테스트 코드 수정 및 테스트 * [refactor] 패키지 이동 * [feat] 가게 메뉴 등록 API 구현 - storeId는 request param 에서 path variable 로 이동 - StoreMenuRegistrationResponse 을 반환하도록 함 * [refactor] responseDTO 를 반환하도록 수정 * [feat] responseDTO 클래스 구현 - 가게 등록 response - 가게 메뉴 등록 response * [refactor] 가게 등록, 가게 메뉴 등록 메서드 반환타입 변경 * [refactor] 기존 커스텀 예외가 NotFoundException, BadRequestException 상속하도록 수정 * [feat] 메뉴 에러 코드 Enum * [feat] Store 예외 핸들러 구현 * [style] 가게 메뉴 등록 서비스에서 발생할 수 있는 RuntimeException javadocs 주석 처리 * [style] 테스트 코드의 주석 제거 * [refactor] 커스텀 예외의 생성자 제거 String message 는 로그를 의미함 로그성 메시지를 강제하기 위해, 이외의 생성자는 제거함 * [fix] Not Null 예외 메시지 추가 * [merge] resolve merge conflict
- Loading branch information
Showing
30 changed files
with
468 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
src/main/java/camp/woowak/lab/menu/exception/InvalidMenuCategoryCreationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package camp.woowak.lab.menu.exception; | ||
|
||
// TODO: extends CustomException | ||
public class InvalidMenuCategoryCreationException extends RuntimeException { | ||
import camp.woowak.lab.common.exception.BadRequestException; | ||
import camp.woowak.lab.common.exception.ErrorCode; | ||
|
||
public InvalidMenuCategoryCreationException(String message) { | ||
super(message); | ||
public class InvalidMenuCategoryCreationException extends BadRequestException { | ||
|
||
public InvalidMenuCategoryCreationException(ErrorCode errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
} |
10 changes: 6 additions & 4 deletions
10
src/main/java/camp/woowak/lab/menu/exception/InvalidMenuCreationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package camp.woowak.lab.menu.exception; | ||
|
||
// TODO: extends CustomException | ||
public class InvalidMenuCreationException extends RuntimeException { | ||
import camp.woowak.lab.common.exception.BadRequestException; | ||
import camp.woowak.lab.common.exception.ErrorCode; | ||
|
||
public InvalidMenuCreationException(String message) { | ||
super(message); | ||
public class InvalidMenuCreationException extends BadRequestException { | ||
|
||
public InvalidMenuCreationException(ErrorCode errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
src/main/java/camp/woowak/lab/menu/exception/NotFoundMenuCategoryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package camp.woowak.lab.menu.exception; | ||
|
||
// TODO: extends CustomException | ||
public class NotFoundMenuCategoryException extends RuntimeException { | ||
import camp.woowak.lab.common.exception.BadRequestException; | ||
import camp.woowak.lab.common.exception.ErrorCode; | ||
|
||
public NotFoundMenuCategoryException(String message) { | ||
super(message); | ||
public class NotFoundMenuCategoryException extends BadRequestException { | ||
|
||
public NotFoundMenuCategoryException(ErrorCode errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/camp/woowak/lab/store/exception/InvalidStoreCreationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package camp.woowak.lab.store.exception; | ||
|
||
import camp.woowak.lab.common.exception.BadRequestException; | ||
import camp.woowak.lab.common.exception.ErrorCode; | ||
|
||
public class InvalidStoreCreationException extends BadRequestException { | ||
|
||
public InvalidStoreCreationException(ErrorCode errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
} |
8 changes: 6 additions & 2 deletions
8
src/main/java/camp/woowak/lab/store/exception/NotEqualsOwnerException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package camp.woowak.lab.store.exception; | ||
|
||
public class NotEqualsOwnerException extends RuntimeException { | ||
import static camp.woowak.lab.store.exception.StoreErrorCode.*; | ||
|
||
import camp.woowak.lab.common.exception.BadRequestException; | ||
|
||
public class NotEqualsOwnerException extends BadRequestException { | ||
|
||
public NotEqualsOwnerException(String message) { | ||
super(message); | ||
super(NOT_EQUALS_VENDOR, message); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/camp/woowak/lab/store/exception/NotFoundStoreCategoryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package camp.woowak.lab.store.exception; | ||
|
||
import camp.woowak.lab.common.exception.NotFoundException; | ||
|
||
public class NotFoundStoreCategoryException extends NotFoundException { | ||
|
||
public NotFoundStoreCategoryException(String message) { | ||
super(StoreErrorCode.INVALID_STORE_CATEGORY, message); | ||
} | ||
|
||
} |
9 changes: 6 additions & 3 deletions
9
src/main/java/camp/woowak/lab/store/exception/NotFoundStoreException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package camp.woowak.lab.store.exception; | ||
|
||
// TODO: 404Exception 상속하도록 수정 | ||
public class NotFoundStoreException extends RuntimeException { | ||
import static camp.woowak.lab.store.exception.StoreErrorCode.*; | ||
|
||
import camp.woowak.lab.common.exception.NotFoundException; | ||
|
||
public class NotFoundStoreException extends NotFoundException { | ||
|
||
public NotFoundStoreException(String message) { | ||
super(message); | ||
super(NOT_FOUND_STORE, message); | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/camp/woowak/lab/store/exception/StoreErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package camp.woowak.lab.store.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
|
||
import camp.woowak.lab.common.exception.ErrorCode; | ||
|
||
public enum StoreErrorCode implements ErrorCode { | ||
NULL_EXIST(HttpStatus.BAD_REQUEST, "S0", "값이 존재해야 합니다."), | ||
|
||
INVALID_NAME_RANGE(HttpStatus.BAD_REQUEST, "S1", "가게 이름은 2글자 ~ 10글자 이어야합니다."), | ||
|
||
INVALID_ADDRESS(HttpStatus.BAD_REQUEST, "S2", "가게 주소는 송파구만 가능합니다."), | ||
|
||
INVALID_MIN_ORDER_PRICE(HttpStatus.BAD_REQUEST, "S3", "최소 주문 금액은 5,000원 이상이어야 합니다."), | ||
INVALID_UNIT_OF_MIN_ORDER_PRICE(HttpStatus.BAD_REQUEST, "S4", "최소 주문 금액은 1,000원 단위이어야 합니다."), | ||
|
||
INVALID_TIME_UNIT(HttpStatus.BAD_REQUEST, "S5", "가게 시작 시간은 분 단위까지 가능합니다"), | ||
INVALID_TIME(HttpStatus.BAD_REQUEST, "S6", "가게 시작 시간은 종료 시간보다 이전이어야 합니다"), | ||
|
||
INVALID_STORE_CATEGORY(HttpStatus.BAD_REQUEST, "S7", "존재하지 않는 가게 카테고리입니다."), | ||
|
||
NOT_EQUALS_VENDOR(HttpStatus.BAD_REQUEST, "S8", "가게의 점주와 일치하지 않습니다."), | ||
NOT_FOUND_STORE(HttpStatus.BAD_REQUEST, "S9", "가게를 찾을 수 없습니다."); | ||
|
||
private final int status; | ||
private final String errorCode; | ||
private final String message; | ||
|
||
StoreErrorCode(HttpStatus status, String errorCode, String message) { | ||
this.status = status.value(); | ||
this.errorCode = errorCode; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
@Override | ||
public String getErrorCode() { | ||
return errorCode; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
src/main/java/camp/woowak/lab/store/exception/StoreException.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.