diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/domain/PokemonAbility.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/domain/PokemonAbility.java index 9a61b5fd..69345740 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/domain/PokemonAbility.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/domain/PokemonAbility.java @@ -9,11 +9,12 @@ import jakarta.persistence.Id; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; -import java.util.List; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; +import java.util.List; + @Entity @Getter @Table(name = "pokemon_ability") @@ -27,8 +28,14 @@ public class PokemonAbility { @Column(name = "name", nullable = false) private String name; - @Column(name = "short_description", nullable = false) - private String shortDescription; + @Column(name = "ko_name", nullable = false) + private String koName; + + @Column(name = "description", nullable = false) + private String description; + + @Column(name = "detail_description", nullable = false) + private String detailDescription; @OneToMany(mappedBy = "pokemonAbility", fetch = FetchType.LAZY) private List pokemonAbilityMappings; diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/dto/PokemonAbilityResponse.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/dto/PokemonAbilityResponse.java index 1f5047b1..82f9741b 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/dto/PokemonAbilityResponse.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/dto/PokemonAbilityResponse.java @@ -2,10 +2,10 @@ import com.pokerogue.helper.ability.domain.PokemonAbility; -public record PokemonAbilityResponse(Long id, String name, String shortDescription) { +public record PokemonAbilityResponse(Long id, String name, String description) { public static PokemonAbilityResponse from(PokemonAbility pokemonAbility) { - return new PokemonAbilityResponse(pokemonAbility.getId(), pokemonAbility.getName(), - pokemonAbility.getShortDescription()); + return new PokemonAbilityResponse(pokemonAbility.getId(), pokemonAbility.getKoName(), + pokemonAbility.getDescription()); } } diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/service/PokemonAbilityService.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/service/PokemonAbilityService.java index b423b549..e68e3259 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/service/PokemonAbilityService.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/ability/service/PokemonAbilityService.java @@ -3,10 +3,11 @@ import com.pokerogue.helper.ability.domain.PokemonAbility; import com.pokerogue.helper.ability.dto.PokemonAbilityResponse; import com.pokerogue.helper.ability.repository.PokemonAbilityRepository; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; + @Service @RequiredArgsConstructor public class PokemonAbilityService { diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/Pokemon.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/Pokemon.java index 25e03462..67ba15ba 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/Pokemon.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/Pokemon.java @@ -23,8 +23,8 @@ public class Pokemon { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @Column(name = "pokemon_number", nullable = false) - private Long pokemonNumber; + @Column(name = "pokedex_number", nullable = false) + private Long pokedexNumber; @Column(name = "name", nullable = false) private String name; @@ -47,6 +47,15 @@ public class Pokemon { @Column(name = "defense", nullable = false) private Integer defense; + @Column(name = "special_attack", nullable = false) + private Integer specialAttack; + + @Column(name = "special_defense", nullable = false) + private Integer specialDefense; + + @Column(name = "total_stats", nullable = false) + private Integer totalStats; + @Column(name = "image", nullable = false) private String image; diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/PokemonTypeMapping.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/PokemonTypeMapping.java index c69be500..28b39cd2 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/PokemonTypeMapping.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/domain/PokemonTypeMapping.java @@ -29,8 +29,4 @@ public class PokemonTypeMapping { @ManyToOne @JoinColumn(name = "pokemon_type_id", nullable = false) private PokemonType pokemonType; - - public String getCircleTypeImage() { - return pokemonType.getCircleImage(); - } } diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokedexResponse.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokedexResponse.java index ffbca635..a97096af 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokedexResponse.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokedexResponse.java @@ -6,11 +6,14 @@ public record PokedexResponse(Long pokedexNumber, String name, String pokemonImage, List pokemonTypeResponses, List pokemonAbilityNames, - Integer weight, Integer height) { + Integer weight, Integer height, Integer attack, Integer defense, + Integer specialAttack, Integer specialDefense, Integer hp, Integer totalStats) { public static PokedexResponse of(Pokemon pokemon, List pokemonTypeResponses, List pokemonAbilityNames) { - return new PokedexResponse(pokemon.getPokemonNumber(), pokemon.getName(), pokemon.getImage(), - pokemonTypeResponses, pokemonAbilityNames, pokemon.getWeight(), pokemon.getHeight()); + return new PokedexResponse(pokemon.getPokedexNumber(), pokemon.getName(), pokemon.getImage(), + pokemonTypeResponses, pokemonAbilityNames, pokemon.getWeight(), pokemon.getHeight(), + pokemon.getAttack(), pokemon.getDefense(), pokemon.getSpecialAttack(), pokemon.getSpecialDefense(), + pokemon.getHp(), pokemon.getTotalStats()); } } diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokemonResponse.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokemonResponse.java index f6222e42..0561ff57 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokemonResponse.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/dto/PokemonResponse.java @@ -1,12 +1,15 @@ package com.pokerogue.helper.pokemon.dto; import com.pokerogue.helper.pokemon.domain.Pokemon; +import com.pokerogue.helper.type.dto.PokemonTypeResponse; + import java.util.List; -public record PokemonResponse(Long id, Long pokedexNumber, String name, String image, List pokemonTypeImages) { +public record PokemonResponse(Long id, Long pokedexNumber, String name, String image, + List pokemonTypeResponses) { - public static PokemonResponse of(Pokemon pokemon, List pokemonTypeImages) { - return new PokemonResponse(pokemon.getId(), pokemon.getPokemonNumber(), pokemon.getName(), pokemon.getImage(), - pokemonTypeImages); + public static PokemonResponse of(Pokemon pokemon, List pokemonTypeResponses) { + return new PokemonResponse(pokemon.getId(), pokemon.getPokedexNumber(), pokemon.getName(), pokemon.getImage(), + pokemonTypeResponses); } } diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/service/PokemonService.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/service/PokemonService.java index cddb9e2a..792c3c0e 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/service/PokemonService.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/pokemon/service/PokemonService.java @@ -9,10 +9,11 @@ import com.pokerogue.helper.pokemon.dto.PokemonResponse; import com.pokerogue.helper.pokemon.repository.PokemonRepository; import com.pokerogue.helper.type.dto.PokemonTypeResponse; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; + @Service @RequiredArgsConstructor public class PokemonService { @@ -30,11 +31,12 @@ public List findPokemons() { private PokemonResponse toPokemonResponse(Pokemon pokemon) { List pokemonTypeMappings = pokemon.getPokemonTypeMappings(); - List pokemonTypeImages = pokemonTypeMappings.stream() - .map(PokemonTypeMapping::getCircleTypeImage) + List pokemonTypeResponses = pokemonTypeMappings.stream() + .map(PokemonTypeMapping::getPokemonType) + .map(PokemonTypeResponse::from) .toList(); - return PokemonResponse.of(pokemon, pokemonTypeImages); + return PokemonResponse.of(pokemon, pokemonTypeResponses); } public PokedexResponse findPokedexDetails(Long id) { diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/type/domain/PokemonType.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/type/domain/PokemonType.java index dc0696da..298ab62d 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/type/domain/PokemonType.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/type/domain/PokemonType.java @@ -23,12 +23,9 @@ public class PokemonType { @Column(name = "name", nullable = false) private String name; - @Column(name = "long_image", nullable = false) - private String longImage; + @Column(name = "ko_name", nullable = false) + private String koName; - @Column(name = "circle_image", nullable = false) - private String circleImage; - - @Column(name = "square_image", nullable = false) - private String squareImage; + @Column(name = "image", nullable = false) + private String image; } diff --git a/backend/pokerogue/src/main/java/com/pokerogue/helper/type/dto/PokemonTypeResponse.java b/backend/pokerogue/src/main/java/com/pokerogue/helper/type/dto/PokemonTypeResponse.java index 654b3ca5..2f675fad 100644 --- a/backend/pokerogue/src/main/java/com/pokerogue/helper/type/dto/PokemonTypeResponse.java +++ b/backend/pokerogue/src/main/java/com/pokerogue/helper/type/dto/PokemonTypeResponse.java @@ -5,6 +5,6 @@ public record PokemonTypeResponse(String pokemonTypeName, String pokemonTypeLogo) { public static PokemonTypeResponse from(PokemonType pokemonType) { - return new PokemonTypeResponse(pokemonType.getName(), pokemonType.getCircleImage()); + return new PokemonTypeResponse(pokemonType.getName(), pokemonType.getImage()); } }