diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/AvatarSpeechProvider.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/AvatarSpeechProvider.java index d5d6037c..301b3cb3 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/AvatarSpeechProvider.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/AvatarSpeechProvider.java @@ -1,10 +1,21 @@ package com.wakeUpTogetUp.togetUp.api.avatar.application; +import com.wakeUpTogetUp.togetUp.api.avatar.application.strategy.SpeechStrategy; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.Avatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeechCondition; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarTheme; import com.wakeUpTogetUp.togetUp.api.avatar.dto.response.AvatarSpeechResponse; -import com.wakeUpTogetUp.togetUp.api.avatar.model.AvatarSpeech; +import com.wakeUpTogetUp.togetUp.api.avatar.repository.AvatarRepository; import com.wakeUpTogetUp.togetUp.api.avatar.repository.AvatarSpeechRepository; +import com.wakeUpTogetUp.togetUp.api.avatar.util.KoreanLunarCalendar; +import com.wakeUpTogetUp.togetUp.api.avatar.util.LunarDate; +import com.wakeUpTogetUp.togetUp.common.Status; +import com.wakeUpTogetUp.togetUp.exception.BaseException; import com.wakeUpTogetUp.togetUp.utils.mapper.EntityDtoMapper; +import java.time.LocalDate; import java.util.List; +import java.util.Map; import java.util.Random; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -13,25 +24,73 @@ @RequiredArgsConstructor public class AvatarSpeechProvider { - private final AvatarSpeechRepository avatarSpeechRepository; private final AvatarValidationService avatarValidationService; private final UserAvatarValidationService userAvatarValidationService; - private final Random rand = new Random(); + + private final AvatarRepository avatarRepository; + private final AvatarSpeechRepository avatarSpeechRepository; + + private final SpeechStrategyFactory speechStrategyFactory; + + private final Random random = new Random(); public AvatarSpeechResponse getUserAvatarSpeech(int userId, int avatarId) { userAvatarValidationService.validateUserAvatarActive(userId, avatarId); - AvatarSpeech avatarSpeech = getAvatarRandomSpeech(avatarId); + String speech = makeSpeechByCondition(getSpeechByAvatar(avatarId)); + + return EntityDtoMapper.INSTANCE.toAvatarSpeechResponse(speech); + } + + private String makeSpeechByCondition(AvatarSpeech avatarSpeech) { + SpeechStrategy strategy = speechStrategyFactory.getStrategy(avatarSpeech.getCondition()); + return strategy.makeSpeech(avatarSpeech); + } - return EntityDtoMapper.INSTANCE.toAvatarSpeechResponse(avatarSpeech); + private AvatarSpeech getSpeechByAvatar(int avatarId) { + Avatar avatar = avatarRepository.findById(avatarId) + .orElseThrow(() -> new BaseException(Status.AVATAR_NOT_FOUND)); + AvatarTheme avatarTheme = AvatarTheme.valueOf(avatar.getTheme()); + + switch (avatarTheme) { + case ASTRONAUT_BEAR: + LocalDate today = LocalDate.now(); + return getByAvatarAndLunarCondition(avatarId, today); + + default: + return getRandomOneByAvatar(avatarId); + } } - private AvatarSpeech getAvatarRandomSpeech(int avatarId) { - List avatarSpeeches = getSpeechesOfAvatar(avatarId); - int randomIndex = rand.nextInt(avatarSpeeches.size()); + + private AvatarSpeech getByAvatarAndLunarCondition(int avatarId, LocalDate today) { + Map lunarConditions = Map.of( + 1, AvatarSpeechCondition.NEW_MOON, + 15, AvatarSpeechCondition.HALF_MOON, + 30, AvatarSpeechCondition.FULL_MOON + ); + + LunarDate lunarDate = KoreanLunarCalendar.convert(today); + int lunarDay = lunarDate.getDay(); + AvatarSpeechCondition condition = lunarConditions.get(lunarDay); + + return condition != null ? + getByAvatarAndCondition(avatarId, condition) : + getRandomOneByAvatar(avatarId); + } + + private AvatarSpeech getByAvatarAndCondition(int avatarId, AvatarSpeechCondition condition) { + return avatarSpeechRepository + .findByAvatarIdAndCondition(avatarId, condition) + .orElseThrow(() -> new BaseException(Status.GET_AVATAR_SPEECH_BY_CONDITION_FAIL)); + } + + private AvatarSpeech getRandomOneByAvatar(int avatarId) { + List avatarSpeeches = getAllByAvatar(avatarId); + int randomIndex = random.nextInt(avatarSpeeches.size()); return avatarSpeeches.get(randomIndex); } - private List getSpeechesOfAvatar(int avatarId) { + private List getAllByAvatar(int avatarId) { avatarValidationService.validateAvatarExist(avatarId); return avatarSpeechRepository.findAllByAvatar_Id(avatarId); } diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/RandomFoodProvider.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/RandomFoodProvider.java new file mode 100644 index 00000000..098d9e2b --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/RandomFoodProvider.java @@ -0,0 +1,6 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application; + +public interface RandomFoodProvider { + + String getRandomFoodWord(); +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/SpeechStrategyFactory.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/SpeechStrategyFactory.java new file mode 100644 index 00000000..5373a5bd --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/SpeechStrategyFactory.java @@ -0,0 +1,33 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application; + +import com.wakeUpTogetUp.togetUp.api.avatar.application.strategy.BasicSpeechStrategy; +import com.wakeUpTogetUp.togetUp.api.avatar.application.strategy.FoodSpeechStrategy; +import com.wakeUpTogetUp.togetUp.api.avatar.application.strategy.SpeechStrategy; +import com.wakeUpTogetUp.togetUp.api.avatar.application.strategy.TimeSpeechStrategy; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeechCondition; +import java.util.EnumMap; +import java.util.Map; +import javax.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class SpeechStrategyFactory { + private static final Map strategies = new EnumMap<>(AvatarSpeechCondition.class); + private final BasicSpeechStrategy basicSpeechStrategy; + private final FoodSpeechStrategy foodSpeechStrategy; + private final TimeSpeechStrategy timeSpeechStrategy; + + @PostConstruct + public void init() { + strategies.put(AvatarSpeechCondition.DEFAULT, basicSpeechStrategy); + strategies.put(AvatarSpeechCondition.NONE, basicSpeechStrategy); + strategies.put(AvatarSpeechCondition.FOOD, foodSpeechStrategy); + strategies.put(AvatarSpeechCondition.TIME, timeSpeechStrategy); + } + + public SpeechStrategy getStrategy(AvatarSpeechCondition condition) { + return strategies.getOrDefault(condition, new BasicSpeechStrategy()); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarQueryService.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarQueryService.java index 42f401b6..15c35ed6 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarQueryService.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarQueryService.java @@ -1,8 +1,8 @@ package com.wakeUpTogetUp.togetUp.api.avatar.application; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.Avatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import com.wakeUpTogetUp.togetUp.api.avatar.dto.response.UserAvatarResponse; -import com.wakeUpTogetUp.togetUp.api.avatar.model.Avatar; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; import com.wakeUpTogetUp.togetUp.api.avatar.repository.AvatarRepository; import com.wakeUpTogetUp.togetUp.api.avatar.repository.UserAvatarRepository; import com.wakeUpTogetUp.togetUp.common.Status; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarService.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarService.java index 00382d8c..161ac96c 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarService.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarService.java @@ -3,8 +3,8 @@ import static com.wakeUpTogetUp.togetUp.common.Constant.DEFAULT_AVATAR_ID; import com.wakeUpTogetUp.togetUp.api.avatar.application.model.UnlockAvatarResult; -import com.wakeUpTogetUp.togetUp.api.avatar.model.Avatar; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.Avatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import com.wakeUpTogetUp.togetUp.api.avatar.repository.AvatarRepository; import com.wakeUpTogetUp.togetUp.api.avatar.repository.UserAvatarRepository; import com.wakeUpTogetUp.togetUp.api.users.domain.User; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarValidationService.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarValidationService.java index 8a005c0b..801b68c8 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarValidationService.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/UserAvatarValidationService.java @@ -1,6 +1,6 @@ package com.wakeUpTogetUp.togetUp.api.avatar.application; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import com.wakeUpTogetUp.togetUp.api.avatar.repository.UserAvatarRepository; import com.wakeUpTogetUp.togetUp.common.Status; import com.wakeUpTogetUp.togetUp.exception.BaseException; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/BasicSpeechStrategy.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/BasicSpeechStrategy.java new file mode 100644 index 00000000..b276df93 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/BasicSpeechStrategy.java @@ -0,0 +1,13 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application.strategy; + +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; +import org.springframework.stereotype.Component; + +@Component +public class BasicSpeechStrategy implements SpeechStrategy{ + + @Override + public String makeSpeech(AvatarSpeech avatarSpeech) { + return avatarSpeech.getSpeech(); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/FoodSpeechStrategy.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/FoodSpeechStrategy.java new file mode 100644 index 00000000..f7150a2e --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/FoodSpeechStrategy.java @@ -0,0 +1,18 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application.strategy; + +import com.wakeUpTogetUp.togetUp.api.avatar.application.RandomFoodProvider; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class FoodSpeechStrategy implements SpeechStrategy{ + + private final RandomFoodProvider randomFoodProvider; + + @Override + public String makeSpeech(AvatarSpeech avatarSpeech) { + return String.format(avatarSpeech.getSpeech(), randomFoodProvider.getRandomFoodWord()); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/SpeechStrategy.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/SpeechStrategy.java new file mode 100644 index 00000000..1a8d7340 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/SpeechStrategy.java @@ -0,0 +1,8 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application.strategy; + +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; + +public interface SpeechStrategy { + + String makeSpeech(AvatarSpeech avatarSpeech); +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/TimeSpeechStrategy.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/TimeSpeechStrategy.java new file mode 100644 index 00000000..17b69661 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/application/strategy/TimeSpeechStrategy.java @@ -0,0 +1,16 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.application.strategy; + +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; +import com.wakeUpTogetUp.togetUp.utils.DateTimeProvider; +import java.time.LocalDateTime; +import org.springframework.stereotype.Component; + +@Component +public class TimeSpeechStrategy implements SpeechStrategy{ + + @Override + public String makeSpeech(AvatarSpeech avatarSpeech) { + LocalDateTime now = DateTimeProvider.getCurrentDateTimeInSeoul(); + return String.format(avatarSpeech.getSpeech(), now.getHour(), now.getMinute()); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/Avatar.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/Avatar.java similarity index 96% rename from src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/Avatar.java rename to src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/Avatar.java index abf44e8a..5395292e 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/Avatar.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/Avatar.java @@ -1,4 +1,4 @@ -package com.wakeUpTogetUp.togetUp.api.avatar.model; +package com.wakeUpTogetUp.togetUp.api.avatar.domain; import com.wakeUpTogetUp.togetUp.common.Status; import com.wakeUpTogetUp.togetUp.exception.BaseException; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeech.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeech.java similarity index 95% rename from src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeech.java rename to src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeech.java index 83bcdc8d..bf7a5c37 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeech.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeech.java @@ -1,4 +1,4 @@ -package com.wakeUpTogetUp.togetUp.api.avatar.model; +package com.wakeUpTogetUp.togetUp.api.avatar.domain; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeechCondition.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeechCondition.java new file mode 100644 index 00000000..15dcf1d8 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarSpeechCondition.java @@ -0,0 +1,13 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.domain; + +public enum AvatarSpeechCondition { + + DEFAULT, + NONE, + FOOD, + TIME, + NEW_MOON, + HALF_MOON, + FULL_MOON + ; +} \ No newline at end of file diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarTheme.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarTheme.java similarity index 71% rename from src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarTheme.java rename to src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarTheme.java index c34a12df..945574b1 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarTheme.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/AvatarTheme.java @@ -1,4 +1,4 @@ -package com.wakeUpTogetUp.togetUp.api.avatar.model; +package com.wakeUpTogetUp.togetUp.api.avatar.domain; import lombok.AccessLevel; import lombok.Getter; @@ -8,4 +8,5 @@ @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public enum AvatarTheme { + ASTRONAUT_BEAR, } diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/UserAvatar.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/UserAvatar.java similarity index 96% rename from src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/UserAvatar.java rename to src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/UserAvatar.java index 1def039f..5422927e 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/UserAvatar.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/domain/UserAvatar.java @@ -1,4 +1,4 @@ -package com.wakeUpTogetUp.togetUp.api.avatar.model; +package com.wakeUpTogetUp.togetUp.api.avatar.domain; import com.wakeUpTogetUp.togetUp.api.users.domain.User; import java.time.LocalDateTime; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeechCondition.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeechCondition.java deleted file mode 100644 index d9b1a09c..00000000 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/model/AvatarSpeechCondition.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.wakeUpTogetUp.togetUp.api.avatar.model; - -public enum AvatarSpeechCondition { - - DEFAULT, - NONE - ; -} \ No newline at end of file diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarRepository.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarRepository.java index e038be06..e45e057c 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarRepository.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarRepository.java @@ -1,6 +1,6 @@ package com.wakeUpTogetUp.togetUp.api.avatar.repository; -import com.wakeUpTogetUp.togetUp.api.avatar.model.Avatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.Avatar; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarSpeechRepository.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarSpeechRepository.java index 2d0df8c5..4d728c95 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarSpeechRepository.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/AvatarSpeechRepository.java @@ -1,10 +1,14 @@ package com.wakeUpTogetUp.togetUp.api.avatar.repository; -import com.wakeUpTogetUp.togetUp.api.avatar.model.AvatarSpeech; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeech; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.AvatarSpeechCondition; import java.util.List; +import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; public interface AvatarSpeechRepository extends JpaRepository { List findAllByAvatar_Id(int avatarId); + + Optional findByAvatarIdAndCondition(Integer avatarId, AvatarSpeechCondition condition); } \ No newline at end of file diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/UserAvatarRepository.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/UserAvatarRepository.java index f181ca0b..fadb3c36 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/UserAvatarRepository.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/repository/UserAvatarRepository.java @@ -1,6 +1,6 @@ package com.wakeUpTogetUp.togetUp.api.avatar.repository; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/KoreanLunarCalendar.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/KoreanLunarCalendar.java new file mode 100644 index 00000000..b4817a84 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/KoreanLunarCalendar.java @@ -0,0 +1,150 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.util; + +import java.time.LocalDate; +import java.util.Calendar; +import java.util.TimeZone; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; + +// TODO: 한국 천문연구원 open api로 변경하기 +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class KoreanLunarCalendar { + + // 2011년에서 2030년까지 지원 + private static final int FROM_YEAR = 2011; + private static final int TO_YEAR = 2030; + + + // start day : 2011-02-03에서 1970-01-01을 뺀 일수 : Calendar.getTimeInMillis() + // 양력 2011-02-03 = 음력 2011-01-01 + private static final int START_DAY = 15008; + + // 음력 달 기초 정보 + // 1 = 평달 작은 달(29일) + // 2 = 평달 큰 달(30일) + // 3 = 윤달있는 달(29일+29일) + // 4 = 윤달있는 달(29일+30일) + // 5 = 윤달있는 달(30일+29일) + // 6 = 윤달있는 달(30일+30일) + private static final byte[][] baseInfo = + { + {2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1}, // 2011 + {2, 1, 6, 2, 1, 2, 1, 1, 2, 1, 2, 1}, + {2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2}, + {1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2}, + {1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1}, + {2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2}, + {1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2}, + {1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2}, + {2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2}, + {2, 1, 2, 5, 2, 1, 1, 2, 1, 2, 1, 2}, + {1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1}, // 2021 + {2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2}, + {1, 5, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2}, + {1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1}, + {2, 1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1}, + {2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2}, + {1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2}, + {1, 2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1}, + {2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2}, + {1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1} + }; + + // [in] y, m, d : 양력 년,월,일 + // [반환값] 음력 변환 결과, [0]=년, [1]=월, [2]=일, [3]=평달이면 0 윤달이면 1 + // [반환값] null == 변환할 범위를 벗어남 + public static LunarDate convert(LocalDate date) { + int y = date.getYear(); + int m = date.getMonthValue(); + int d = date.getDayOfMonth(); + + Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + c.set(y, m - 1, d); + + d = (int) (c.getTimeInMillis() / (24 * 60 * 60 * 1000)) - START_DAY; + if (d < 0 || y > TO_YEAR) { + return null; + } + + y = m = 0; + + int i, j, n; + int leap = 0; // 0=평달, 1=윤달 + + while (true) { + for (i = j = 0; i < 12; i++) { + switch (baseInfo[y][i]) { + case 1: + j += 29; + break; + case 2: + j += 30; + break; + case 3: + j += 29 + 29; + break; + case 4: // j += 29 + 30; break; + case 5: + j += 30 + 29; + break; + case 6: + j += 30 + 30; + break; + } + } + + if (d >= j) { + d -= j; + y++; + } else { + break; + } + } + + while (true) { + if (baseInfo[y][m] <= 2) { + n = baseInfo[y][m] + 28; + if (d >= n) { + d -= n; + m++; + } else { + break; + } + } else { + switch (baseInfo[y][m]) { + case 3: + i = 29; + j = 29; + break; + case 4: + i = 29; + j = 30; + break; + case 5: + i = 30; + j = 29; + break; + case 6: + i = 30; + j = 30; + break; + } + + if (d >= i) { + d -= i; + if (d >= j) { + d -= j; + m++; + } else { + leap = 1; + break; + } + } else { + break; + } + } + } + + return LunarDate.of(y + FROM_YEAR, m + 1, d + 1, leap); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/LunarDate.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/LunarDate.java new file mode 100644 index 00000000..fc13ea94 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/LunarDate.java @@ -0,0 +1,13 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.util; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor(staticName = "of") +@Getter +public class LunarDate { + private int year; + private int month; + private int day; + private int leap; +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/RandomFoodProviderImpl.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/RandomFoodProviderImpl.java new file mode 100644 index 00000000..d86b8165 --- /dev/null +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/avatar/util/RandomFoodProviderImpl.java @@ -0,0 +1,22 @@ +package com.wakeUpTogetUp.togetUp.api.avatar.util; + +import com.wakeUpTogetUp.togetUp.api.avatar.application.RandomFoodProvider; +import java.util.List; +import java.util.Random; +import org.springframework.stereotype.Component; + +@Component +public class RandomFoodProviderImpl implements RandomFoodProvider { + private static final List FOODS = List.of( + "피자", "햄버거", "스시", "파스타", "샐러드", "김치찌개", "비빔밥", "초밥", "스테이크", + "라면", "냉면", "갈비", "삼겹살", "떡볶이", "칼국수", "보쌈", "닭갈비", "감자탕", "카레", "돈까스", + "곱창", "치킨", "해물파전", "타코", "딤섬", "똠얌꿍", "팟타이", "케밥", "라멘", "우동", "타코야키", + "스키야키", "훠궈", "마라탕", "꿔바로우", "짜장면", "탕수육", "양꼬치", "깐풍기", "대나무"); + + private static final Random RANDOM = new Random(); + + @Override + public String getRandomFoodWord() { + return FOODS.get(RANDOM.nextInt(FOODS.size())); + } +} diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/api/users/domain/User.java b/src/main/java/com/wakeUpTogetUp/togetUp/api/users/domain/User.java index eb29d072..28c71dad 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/api/users/domain/User.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/api/users/domain/User.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.wakeUpTogetUp.togetUp.api.auth.LoginType; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import com.wakeUpTogetUp.togetUp.api.room.model.RoomUser; import com.wakeUpTogetUp.togetUp.api.users.domain.model.UserProgressResult; import com.wakeUpTogetUp.togetUp.api.users.fcmToken.FcmToken; diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/common/Status.java b/src/main/java/com/wakeUpTogetUp/togetUp/common/Status.java index 6aa70968..0739dcb9 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/common/Status.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/common/Status.java @@ -83,6 +83,7 @@ public enum Status { FIND_DEFAULT_AVATAR_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "기본 아바타를 불려오는데 실패했습니다."), FIND_USER_AVATAR_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "유저의 대표 아바타 정보를 불러오는데 실패했습니다."), GET_AVATAR_DEFAULT_SPEECH_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "아바타 기본 대사를 불러오지 못했습니다."), + GET_AVATAR_SPEECH_BY_CONDITION_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "조건의 부합하는 아바타 대사를 불러오지 못했습니다."), LOAD_MODEL_FAILURE(HttpStatus.INTERNAL_SERVER_ERROR, "모델 객체 정보 불러오기를 실패했습니다."), FILE_IO_EXCEPTION(HttpStatus.INTERNAL_SERVER_ERROR, "파일을 불러오지 못했습니다."), GET_LATEST_APP_VERSION_FAIL(HttpStatus.INTERNAL_SERVER_ERROR, "앱 최신버전 정보를 불러오는데 실패했습니다.") diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/utils/DateTimeProvider.java b/src/main/java/com/wakeUpTogetUp/togetUp/utils/DateTimeProvider.java index 5ab057a4..458f95c4 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/utils/DateTimeProvider.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/utils/DateTimeProvider.java @@ -1,11 +1,11 @@ package com.wakeUpTogetUp.togetUp.utils; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Locale; - import org.springframework.stereotype.Component; @Component @@ -16,6 +16,10 @@ public static LocalDate getCurrentDateInSeoul() { return ZonedDateTime.now(SEOUL_ZONE_ID).toLocalDate(); } + public static LocalDateTime getCurrentDateTimeInSeoul() { + return ZonedDateTime.now(SEOUL_ZONE_ID).toLocalDateTime(); + } + public static String getDateTime(String format) { return ZonedDateTime.now(SEOUL_ZONE_ID) .format( diff --git a/src/main/java/com/wakeUpTogetUp/togetUp/utils/mapper/EntityDtoMapper.java b/src/main/java/com/wakeUpTogetUp/togetUp/utils/mapper/EntityDtoMapper.java index fa205a1f..3a6f2fd6 100644 --- a/src/main/java/com/wakeUpTogetUp/togetUp/utils/mapper/EntityDtoMapper.java +++ b/src/main/java/com/wakeUpTogetUp/togetUp/utils/mapper/EntityDtoMapper.java @@ -3,11 +3,10 @@ import com.wakeUpTogetUp.togetUp.api.alarm.dto.response.AlarmSimpleRes; import com.wakeUpTogetUp.togetUp.api.alarm.dto.response.GetAlarmRes; import com.wakeUpTogetUp.togetUp.api.alarm.model.Alarm; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.Avatar; +import com.wakeUpTogetUp.togetUp.api.avatar.domain.UserAvatar; import com.wakeUpTogetUp.togetUp.api.avatar.dto.response.AvatarSpeechResponse; import com.wakeUpTogetUp.togetUp.api.avatar.dto.response.UserAvatarResponse; -import com.wakeUpTogetUp.togetUp.api.avatar.model.Avatar; -import com.wakeUpTogetUp.togetUp.api.avatar.model.AvatarSpeech; -import com.wakeUpTogetUp.togetUp.api.avatar.model.UserAvatar; import com.wakeUpTogetUp.togetUp.api.mission.dto.response.GetMissionLogRes; import com.wakeUpTogetUp.togetUp.api.mission.dto.response.GetMissionObjectRes; import com.wakeUpTogetUp.togetUp.api.mission.dto.response.GetMissionWithObjectListRes; @@ -79,5 +78,5 @@ default void setIsUnlockedStatus( .anyMatch(userAvatar -> userAvatar.getAvatar().getId().equals(avatar.getId()))); } - AvatarSpeechResponse toAvatarSpeechResponse(AvatarSpeech avatarSpeech); + AvatarSpeechResponse toAvatarSpeechResponse(String speech); } diff --git a/src/main/resources/migration/data.sql b/src/main/resources/migration/data.sql index 704256d1..b09f77be 100644 --- a/src/main/resources/migration/data.sql +++ b/src/main/resources/migration/data.sql @@ -94,75 +94,92 @@ VALUES (6, 'PHILOSOPHER_RACCOON', '철학자 너구리', 75, '2024-02-19 23:22:5 -- 아바타 대사 -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (1, '안녕, 내가 니 선임이야~', 'DEFAULT', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (2, '신입 어서오공~', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (3, '야야 그래가지구\\n언제 레벨 업할래!', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (4, '밥은 꼭 챙겨 먹어랑~', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (5, '미션 10회 실시!', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (6, '삐약... 졸리당', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (7, '병아리가 가장 잘 먹는 약은?\\n......삐약!', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (8, '드디어 막내 탈출이당!', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (9, '오~ 웬일?', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (10, '너 생각보다 잘하는뎅?', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (11, '막내야 물 좀 떠와랑~', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (12, '야야 참아\\n그래도 내가 니 선배양~', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (13, '야야 밥은 내가 쏜당~', 'NONE', 1); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (14, '나랑 같이 우주탐험 하지 않을래?', 'DEFAULT', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (15, '우주는 엄청 넓고 어둡구나…\\n저 너머에는 뭐가 있을까?', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (16, '달이 꼭 노릇노릇한 빵 같은걸!\\n우리도 든든하게 먹고 힘내자~', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (17, '오늘은 달이 밝네~\\n왠지 미션을 잘 끝낼 수 있을 것 같아!', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (18, '모든 미션 완료!\\n다음에는 뭘 할지 기대되는걸?', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (19, '반짝반짝 작은별~\\n보석처럼 예쁘다…', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (20, '저기 은하수가 보여!\\n가서 헤엄치고 싶다~', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (21, '내 우주선?\\n직접 만든거야! 멋있지?', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (22, '안녕!\\n친구와 미션을 함께하니 더 의욕이 생긴다~', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (23, '우주에서 별을 찾는 미션이 있는데,\\n같이 할래?', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (24, '우주 모험은 언제나 즐거워!', 'NONE', 2); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (25, '사랑을 나누어 드릴게요...', 'DEFAULT', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (26, '누군가에게 내 마음을 전해줄 수 있을까?\\n장미도, 케이크도 다 준비했어요!', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (27, '저의 볼이 분홍색이 될 때까지 당신을 생각했답니다.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (28, '이 꽃들과 달콤한 케이크,\\n누구에게 줄까 하고 고민 중이에요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (29, '눈이 반짝반짝 빛나요,\\n누군가에게 이 딸기 케이크를 나눠줄 생각을 하니까요!', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (30, '사랑을 전하는 걸음걸음이 춤추듯 가벼워요,\\n꽃다발과 케이크를 들고서요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (31, '수줍고 달콤한,\\n이 작은 토끼 친구가 마음을 담은 선물을 가지고 있어요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (32, '저는 사랑을 전하는 메신저예요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (33, '제 발걸음에 봄이 왔어요,\\n평범한 하루를 사랑의 축제로 바꾸기 위한 임무를 가지고요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (34, '이렇게 사랑스러운 토끼 앞에서는\\n꽃들도 수줍어할 거예요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (35, '내 크고 분홍색 마음은\\n케이크만큼이나 사랑으로 가득 차 있어요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (36, '당신은 간단한 것에서\\n기쁨을 찾는 법을 아세요?', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (37, '사랑스러운 고민에 빠져,\\n준비한 마음을 정말 줘도 될지 생각 중이에요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (38, '꽃다발의 리본을 예쁘게 묶었어요,\\n친구들에게 전할 사랑처럼요.', 'NONE', 3); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (39, '먹는게 세상에서 제일 좋아~', 'DEFAULT', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (40, '실은 나, 얼마나 배가 고픈지로 \\n지금 몇 시인지 알 수 있어~\\n꼬르륵~ 현재 %d시야,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (41, '나 지금 대나무 냄새 느껴졌어,,\\n혹시 숨기고있는거 아니지!\\n같이 먹자구~~ ', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (42, '요즘 매일같이 닭가슴살을 먹고 있는데에.. 이제 한동안은 쳐다도 보기 싫어! ', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (43, '저녁밥 먹고 디저트로 뭘 먹을지 정하질 못하겠어~ 앗, 그래! 둘 다 먹으면 되겠다아!', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (44, '내가 좋아하는 대나무에 둘러싸여서 느긋하게 시간을 보내고 싶다아~', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (45, '한 입 정도는 괜찮잖아~', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (46, '나 오늘부터 다이어트 시작이다… ', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (47, '이번 여름,,, 달라진 모습 기대해줘', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (48, '냉장고안에 있는 초콜릿,, 내꺼다 건들 ㄴ', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (49, '오늘 저녁은 %s 어때~~???', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (50, '점심으로 가볍게 샌드위치먹을까??', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (51, '치느님 영접할때가 되었어,, 치느님이 날 부르고 있어,,,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (52, '맛없는걸로 배 채우는건 바보같은 짓이야,,, 한끼 한끼가 소중하다구,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (53, '대나무는 윗 부분보다는,, 아랫 부분이야,,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (54, '우웩,, 나뭇잎은,, 먹기싫어요,,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (55, '나무 올라타는건 힘들어,,, 하지만 운동은 해야하니까', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (56, '요즘 나 김밥 안에 오이는 먹을수 있짜나 이제 나도 어른일지도,,,', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (57, '커피는 너무 써,,, 초코라떼 먹어야지~~~', 'NONE', 4); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (58, '저와 비오는 날을 함께 해요!', 'DEFAULT', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (59, '비가 오는 날은 집에서 쉬는 게 최고죠. 우리 함께 뒹굴뒹굴해요!', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (60, '젖은 발바닥, 신경 쓰지 마세요. 저도 비 오는 날엔 자주 그래요!', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (61, '비가 와서 산책이 걱정되나요? 제가 용기를 드릴게요!', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (62, '우리 같이 빗소리를 들으며 잠시 휴식을 취해요. 어떨까요?', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (63, '비가 오면 세상이 깨끗해지는 것 같아요. 마음도 같이 씻겨나가는 기분이죠.', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (64, '빗방울 소리 듣는 걸 좋아하세요? 저도 좋아해요, 마음이 편해져요.', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (65, '비 내리는 창밖을 같이 바라볼까요? 저에게는 최고의 시간이에요.', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (66, '비가 오면, 저는 항상 창가에 앉아 빗방울을 세곤 해요. 당신도 같이 해보실래요?', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (67, '비가 내리는 소리, 들어보셨나요? 저는 그 소리가 좋아요. 마음을 진정시켜주거든요.', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (68, '비가 오는 날은 집 안에서 코를 박고 자는 것도 좋지만, 가끔은 밖의 세상도 탐험해야죠!', 'NONE', 5); -INSERT INTO avatar_speech (id, speech, `condition`, avatar_id) VALUES (69, '널 철학의 세계로 인도하지...', 'DEFAULT', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('안녕, 내가 니 선임이야~', 'DEFAULT', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('신입 어서오공~', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('야야 그래가지구\\n언제 레벨 업할래!', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('밥은 꼭 챙겨 먹어랑~', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('미션 10회 실시!', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('삐약... 졸리당', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('병아리가 가장 잘 먹는 약은?\\n......삐약!', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('드디어 막내 탈출이당!', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('오~ 웬일?', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('너 생각보다 잘하는뎅?', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('막내야 물 좀 떠와랑~', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('야야 참아\\n그래도 내가 니 선배양~', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('야야 밥은 내가 쏜당~', 'NONE', 1); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('나랑 같이 우주탐험 하지 않을래?', 'DEFAULT', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('우주는 엄청 넓고 어둡구나…\\n저 너머에는 뭐가 있을까?', 'NEW_MOON', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('달이 꼭 노릇노릇한 빵 같은걸!\\n우리도 든든하게 먹고 힘내자~', 'HALF_MOON', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('오늘은 달이 밝네~\\n왠지 미션을 잘 끝낼 수\\n있을 것 같아!', 'FULL_MOON', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('반짝반짝 작은별~\\n보석처럼 예쁘다…', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('저기 은하수가 보여!\\n가서 헤엄치고 싶다~', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('내 우주선?\\n직접 만든거야! 멋있지?', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('안녕!\\n친구와 미션을 함께하니\\n더 의욕이 생긴다~', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('우주에서 별을 찾는 미션이\\n있는데, 같이 할래?', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('우주 모험은 언제나 즐거워!', 'NONE', 2); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('사랑을 나누어 드릴게요...', 'DEFAULT', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('누군가에게 내 마음을 전해줄 수 있을까?\\n장미도, 케이크도 다 준비했어요!', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('저의 볼이 분홍색이 될 때까지 당신을 생각했답니다.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('이 꽃들과 달콤한 케이크,\\n누구에게 줄까 하고 고민 중이에요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('눈이 반짝반짝 빛나요,\\n누군가에게 이 딸기 케이크를 나눠줄 생각을 하니까요!', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('사랑을 전하는 걸음걸음이 춤추듯 가벼워요,\\n꽃다발과 케이크를 들고서요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('수줍고 달콤한,\\n이 작은 토끼 친구가 마음을 담은 선물을 가지고 있어요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('저는 사랑을 전하는 메신저예요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('제 발걸음에 봄이 왔어요,\\n평범한 하루를 사랑의 축제로 바꾸기 위한 임무를 가지고요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('이렇게 사랑스러운 토끼 앞에서는\\n꽃들도 수줍어할 거예요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('내 크고 분홍색 마음은\\n케이크만큼이나 사랑으로 가득 차 있어요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('당신은 간단한 것에서\\n기쁨을 찾는 법을 아세요?', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('사랑스러운 고민에 빠져,\\n준비한 마음을 정말 줘도 될지 생각 중이에요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('꽃다발의 리본을 예쁘게 묶었어요,\\n친구들에게 전할 사랑처럼요.', 'NONE', 3); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('먹는게 세상에서 제일 좋아~', 'DEFAULT', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('실은 나, 얼마나 배가 고픈지로\\n지금 시간을 알 수 있어~\\n꼬르륵~ 현재 %d시 %d분 이야,,', 'TIME', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('나 지금 대나무 냄새 느껴졌어,,\\n혹시 숨기고있는거 아니지!\\n같이 먹자구~~ ', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('요즘 매일같이 닭가슴살을 먹고 있는데에.. 이제 한동안은 쳐다도 보기 싫어! ', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('저녁밥 먹고 디저트로 뭘 먹을지 정하질 못하겠어~ 앗, 그래! 둘 다 먹으면 되겠다아!', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('내가 좋아하는 대나무에 둘러싸여서 느긋하게 시간을 보내고 싶다아~', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('한 입 정도는 괜찮잖아~', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('나 오늘부터 다이어트 시작이다… ', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('이번 여름,,, 달라진 모습 기대해줘', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('냉장고안에 있는 초콜릿,, 내꺼다 건들 ㄴ', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('오늘 저녁은 %s 어때~~???', 'FOOD', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('내일 점심으론\\n가볍게 %s 먹을까??', 'FOOD', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('치느님 영접할때가 되었어,,,\\n치느님이 날 부르고 있어,,!', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('맛없는걸로 배 채우는건\\n바보같은 짓이야,,,\\n한끼 한끼가 소중하다구,,', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('대나무는 윗 부분보다는,,\\n아랫 부분이야,,,', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('우웩,,\\n나뭇잎은,, 먹기싫어요,,,', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('나무 올라타는건 힘들어,,,\\n하지만 운동은 해야하니까', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('요즘 나 김밥 안에 오이는 먹을수 있짜나 이제 나도 어른일지도,,,', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('커피는 너무 써,,, 초코라떼 먹어야지~~~', 'NONE', 4); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('저와 비오는 날을 함께 해요!', 'DEFAULT', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 오는 날은 집에서 쉬는 게 최고죠. 우리 함께 뒹굴뒹굴해요!', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('젖은 발바닥, 신경 쓰지 마세요. 저도 비 오는 날엔 자주 그래요!', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 와서 산책이 걱정되나요? 제가 용기를 드릴게요!', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('우리 같이 빗소리를 들으며 잠시 휴식을 취해요. 어떨까요?', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 오면 세상이 깨끗해지는 것 같아요. 마음도 같이 씻겨나가는 기분이죠.', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('빗방울 소리 듣는 걸 좋아하세요? 저도 좋아해요, 마음이 편해져요.', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비 내리는 창밖을 같이 바라볼까요? 저에게는 최고의 시간이에요.', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 오면, 저는 항상 창가에 앉아 빗방울을 세곤 해요. 당신도 같이 해보실래요?', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 내리는 소리, 들어보셨나요? 저는 그 소리가 좋아요. 마음을 진정시켜주거든요.', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('비가 오는 날은 집 안에서 코를 박고 자는 것도 좋지만, 가끔은 밖의 세상도 탐험해야죠!', 'NONE', 5); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('널 철학의 세계로 인도하지...', 'DEFAULT', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('삶이 있는 한 희망은 있다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('언제나 현재에 집중할수\\n있다면 행복할것이다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('신은 용기 있는 자를\\n결코 버리지 않는다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('행복한 삶을 살기 위해\\n필요한 것은 거의 없다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('절대 어제를 후회하지 마라.\\n인생은 오늘의 나 안에 있고\\n내일은 스스로 만드는 것이다', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('한번의 실패와 영원한 실패를\\n혼동하지 마라.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('피할수 없으면 즐겨라.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('오랫동안 꿈을 그리는 사람은\\n마침내 그 꿈을 닮아 간다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('평생 살 것처럼 꿈을 꾸어라.\\n그리고 내일 죽을 것처럼 오늘을 살아라.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('고통이 남기고 간 뒤를 보라!\\n고난이 지나면 반드시 기쁨이 스며든다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('돈이란 바닷물과도 같다.\\n그것은 마시면 마실수록 목이 말라진다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('사막이 아름다운 것은\\n어딘가에 샘이 숨겨져 있기 때문이다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('내 비장의 무기는 아직 손안에 있다.\\n그것은 희망이다.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('겨울이 오면 봄이 멀지 않으리.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('인생을 다시 산다면 다음번에는\\n더 많은 실수를 저지르리라.', 'NONE', 6); +INSERT INTO avatar_speech (speech, `condition`, avatar_id) VALUES ('인생에 뜻을 세우는데 있어 늦은 때라곤 없다.', 'NONE', 6); + -- 앱 버전 히스토리 -INSERT INTO app_version_history (version, app_store_url, created_at) VALUES ('1.0.0', '미정', '2024-05-02 13:28:03'); \ No newline at end of file +INSERT INTO app_version_history (version, app_store_url, created_at) VALUES ('1.0.0', 'https://apps.apple.com/kr/app/togetup/id6477523543', '2024-05-02 13:28:03'); +INSERT INTO app_version_history (version, app_store_url, created_at) VALUES ('1.0.1', 'https://apps.apple.com/kr/app/togetup/id6477523543', '2024-05-02 13:28:03'); \ No newline at end of file