-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/elastic' of https://github.com/nhnacademy-be5-T…
…3Team/bookstore-api into feature/elastic
- Loading branch information
Showing
141 changed files
with
4,681 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: feature branch test | ||
name: feature-test | ||
on: | ||
push: | ||
branches: | ||
|
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
17 changes: 17 additions & 0 deletions
17
src/main/java/com/t3t/bookstoreapi/book/annotation/UniqueParticipantMap.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,17 @@ | ||
package com.t3t.bookstoreapi.book.annotation; | ||
|
||
import com.t3t.bookstoreapi.book.validator.UniqueParticipantMapValidator; | ||
|
||
import javax.validation.Constraint; | ||
import javax.validation.Payload; | ||
import java.lang.annotation.*; | ||
|
||
@Documented | ||
@Constraint(validatedBy = UniqueParticipantMapValidator.class) | ||
@Target({ ElementType.FIELD }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface UniqueParticipantMap { | ||
String message() default "중복된 참여자와 역할 조합이 있습니다."; | ||
Class<?>[] groups() default {}; | ||
Class<? extends Payload>[] payload() default {}; | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/t3t/bookstoreapi/book/converter/StringToParticipantMapDtoConverter.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,32 @@ | ||
package com.t3t.bookstoreapi.book.converter; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.t3t.bookstoreapi.book.exception.ConversionException; | ||
import org.springframework.core.convert.converter.Converter; | ||
import com.t3t.bookstoreapi.book.model.dto.ParticipantMapDto; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class StringToParticipantMapDtoConverter implements Converter<String, List<ParticipantMapDto>> { | ||
|
||
/** | ||
* 주어진 문자열을 JSON으로 변환하고, 그 JSON을 ParticipantMapDto 객체의 리스트로 변환 | ||
* | ||
* @param source JSON 형식의 문자열 | ||
* @return ParticipantMapDto 객체의 리스트 | ||
* @throws ConversionException 변환 과정에서 발생한 예외 | ||
* @author Yujin-nKim(김유진) | ||
*/ | ||
@Override | ||
public List<ParticipantMapDto> convert(String source) { | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
try { | ||
// JSON 문자열을 List<ParticipantMapDto> 객체로 변환 | ||
return Arrays.asList(objectMapper.readValue(source, ParticipantMapDto[].class)); | ||
} catch (IOException e) { | ||
throw new ConversionException("문자열을 ParticipantMapDto 리스트로 변환하는 중에 오류가 발생했습니다.", e); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/t3t/bookstoreapi/book/exception/BookAlreadyDeletedException.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 com.t3t.bookstoreapi.book.exception; | ||
|
||
public class BookAlreadyDeletedException extends RuntimeException{ | ||
|
||
private static final String DEFAULT_MESSAGE = "이미 삭제된 도서입니다."; | ||
|
||
public BookAlreadyDeletedException() { | ||
super(DEFAULT_MESSAGE); | ||
} | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
src/main/java/com/t3t/bookstoreapi/book/exception/BookAlreadyExistsException.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,10 @@ | ||
package com.t3t.bookstoreapi.book.exception; | ||
|
||
public class BookAlreadyExistsException extends RuntimeException{ | ||
|
||
private static final String DEFAULT_MESSAGE = "이미 등록된 도서입니다."; | ||
|
||
public BookAlreadyExistsException() { | ||
super(DEFAULT_MESSAGE); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/t3t/bookstoreapi/book/exception/ConversionException.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,15 @@ | ||
package com.t3t.bookstoreapi.book.exception; | ||
|
||
public class ConversionException extends RuntimeException { | ||
|
||
/** | ||
* 지정된 메시지와 원인(Throwable)을 사용하여 ConversionException을 생성 | ||
* | ||
* @param message 예외에 대한 설명 메시지 | ||
* @param cause 원인 예외 | ||
* @author Yujin-nKim(김유진) | ||
*/ | ||
public ConversionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
Oops, something went wrong.