-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE-FEAT] 바이옴 세부 정보를 불러오는 API (#253)
* refactor: txt파일 형식 변경에 따른 파싱 로직 수정 * feat: 바이옴 세부 정보 불러오는 API * refactor: 바이옴, 트레이너 사진을 가져오도록 수정 * chore: 서브모듈 시점 변경 * refactor: findById의 반환 값 수정 * chore: 서브모듈 커밋 시점 변경 * chore: 서브모듈 커밋 시점 변경 * feat: 바이옴 세부정보 불러오는 기능 * chore: 서브모듈 커밋 시점 변경 * fix: 테스트 통과 못하는 오류 수정 * refactor: 아이디 형식 변경에 따른 수정 * chore: 서브모듈 커밋 시점 변경 * refactor: 불필요한 로그 삭제 * style: 개행 추가 * refactor: 포켓몬 이미지 url 전송 기능 * refactor: 초기화 과정에서 포켓몬 이미지 url 저장하도록 수정 * refactor: 필드 이름 변경 * refactor: 이미지 폴더 경로 수정 * refactor: 메서드명 수정 * fix: 트레이너나 포켓몬이 없을 시 오류처리하는 로직 수정 * fix: 트레이너나 포켓몬이 없을 시 오류처리하는 로직 수정 * refactor: 다음 바이옴 이름과 출현 확률 추가 * chore: 서브모듈 커밋 시점 변경 * refactor: 마지막 스테이지 다음 바이옴 빈값 반환하도록 수정
- Loading branch information
Showing
26 changed files
with
533 additions
and
58 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
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
11 changes: 8 additions & 3 deletions
11
backend/pokerogue/src/main/java/com/pokerogue/helper/biome/data/BiomeLink.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,17 +1,22 @@ | ||
package com.pokerogue.helper.biome.data; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class BiomeLink { | ||
|
||
private final String id; | ||
private final String currentBiome; | ||
private final List<String> nextBiomes; | ||
private final List<NextBiome> nextBiomes; | ||
|
||
public BiomeLink(String biomeLink) { | ||
String[] biomeLinkInforms = biomeLink.split(" / "); | ||
this.currentBiome = biomeLinkInforms[0]; | ||
this.nextBiomes = List.of(biomeLinkInforms[1].split(",")); | ||
this.id = biomeLinkInforms[0]; | ||
this.currentBiome = biomeLinkInforms[1]; | ||
this.nextBiomes = Arrays.stream(biomeLinkInforms[2].split(",")) | ||
.map(s -> new NextBiome(s.split("~")[0], s.split("~")[1])) | ||
.toList(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/pokerogue/src/main/java/com/pokerogue/helper/biome/data/BiomePokemonInfo.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.pokerogue.helper.biome.data; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class BiomePokemonInfo { | ||
|
||
private final String id; | ||
private final String name; | ||
private final String image; | ||
private final BiomePokemonType type1; | ||
private final BiomePokemonType type2; | ||
} |
44 changes: 44 additions & 0 deletions
44
backend/pokerogue/src/main/java/com/pokerogue/helper/biome/data/BiomePokemonType.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,44 @@ | ||
package com.pokerogue.helper.biome.data; | ||
|
||
import com.pokerogue.helper.global.exception.ErrorMessage; | ||
import com.pokerogue.helper.global.exception.GlobalCustomException; | ||
import java.util.Arrays; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum BiomePokemonType { | ||
|
||
GRASS("풀"), | ||
POISON("독"), | ||
FIRE("불꽃"), | ||
WATER("물"), | ||
ELECTRIC("전기"), | ||
NORMAL("노말"), | ||
FAIRY("페어리"), | ||
BUG("벌레"), | ||
DARK("악"), | ||
DRAGON("드래곤"), | ||
FIGHTING("격투"), | ||
FLYING("비행"), | ||
GHOST("고스트"), | ||
GROUND("땅"), | ||
ICE("얼음"), | ||
ROCK("바위"), | ||
PSYCHIC("에스퍼"), | ||
STEEL("강철"), | ||
STELLAR("스텔라"), | ||
UNKNOWN("없음"); | ||
|
||
private final String name; | ||
|
||
BiomePokemonType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public static BiomePokemonType getBiomePokemonTypeByName(String name) { | ||
return Arrays.stream(values()) | ||
.filter(biomePokemonType -> biomePokemonType.name.equals(name)) | ||
.findFirst() | ||
.orElseThrow(() -> new GlobalCustomException(ErrorMessage.POKEMON_TYPE_NOT_FOUND)); | ||
} | ||
} |
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
Oops, something went wrong.