Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@
@Slf4j
public class GardenService {

private final WishTreeService wishTreeService;

private static final int MAX_GARDEN_COUNT = 3;
private static final Long WATERING_POINTS = 2L;
private static final Long SUNLIGHT_POINTS = 3L;
private static final Long MAX_FRIEND_WATERING_PER_DAY = 3L;

private final WishTreeService wishTreeService;
private final GardenRepository gardenRepository;
private final UserService userService;
private final ApplicationEventPublisher eventPublisher;
Expand Down Expand Up @@ -199,6 +197,7 @@ public void unlockNewGardenSlot(Long userId) {
ErrorCode.GARDEN_SLOT_LOCKED, "현재 단계에서는 더 이상 텃밭을 만들 수 없습니다. 소원나무를 성장시켜주세요.");
}

// TODO: 여기 뭔가 수정해야할 듯 아바타는 설정해서 가져오고 배경화면은 그냥 기본걸 씀
// 5. 새로 생성될 텃밭의 기본 배경과 아바타를 설정 (ID 1L을 기본값으로 가정)
GardenBackground defaultBackground =
gardenBackgroundRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
@Builder
public class UserGardenDetailResponse {
private Long gardenId;
private int waterCount;
private int maxWaterCount;
private HomeResponseDto.AvatarInfo avatarInfo; // 해당 정원에 배치된 아바타의 상세 정보

private Boolean isWateringAbleByMe; // 현재 접속 유저가 이 정원에 물을 줄 수 있는지 여부
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UserProfileResponse {
// 2: 나를 팔로우 중 (맞팔로우 버튼 보임) - 이 상태는 isFriend가 false일 때만 의미
private Integer followStatus; // 0: NOT_FOLLOWING, 1: FOLLOWING, 2: FOLLOW_BACK_POSSIBLE

private int profileUserLevel; // 프로필 주인의 레벨 추가
// private int profileUserLevel; // 프로필 주인의 레벨 추가
private Long leftWaterCountForOthers; // 오늘 남에게 물을 줄 수 있는 남은 횟수 (현재 접속 유저 기준)

// 프로필 주인의 모든 정원 목록. 각 정원마다 물주기 가능 여부 포함
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ public UserProfileResponse getUserProfile(Long currentUserId, Long profileUserId
// GardenResponse 대신 UserGardenDetailResponse를 빌드
return UserGardenDetailResponse.builder()
.gardenId(garden.getId())
.waterCount(garden.getWaterCount())
.maxWaterCount(100)
.avatarInfo(avatarInfoForGarden)
.isWateringAbleByMe(isWateringAbleByMe)
.build();
Expand All @@ -238,7 +236,6 @@ public UserProfileResponse getUserProfile(Long currentUserId, Long profileUserId
.userNickname(profileUser.getNickname())
.profileImageUrl(profileImageUrl)
.followStatus(followStatus)
.profileUserLevel(profileUser.getLevel())
.leftWaterCountForOthers(leftWaterCountForOthers)
.userGardens(userGardens)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public enum WishTreeStage {
SPROUT(1000L, "새싹", 1L),
FLOWER(2150L, "꽃", 2L), // 1000 + 1150
FRUIT(3450L, "열매", 3L), // 2150 + 1300
TREE(4900L, "나무", 4L), // 3450 + 1450
FINAL(Long.MAX_VALUE, "최종 나무", 5L); // 더 이상 성장 안함
TREE(4900L, "나무", 4L), // 3450 + 1450, 최대 텃밭 개수
FINAL(Long.MAX_VALUE, "최종 나무", 4L); // 더 이상 성장 안함, 최대 텃밭 개수

private final Long requiredPointsForNextStage;
private final String koreanName;
Expand All @@ -34,7 +34,12 @@ public WishTreeStage getNextStage() {
return values()[this.ordinal() + 1];
}

public Long getMaxGardens(WishTreeStage stage) {
return stage.maxGardens;
/**
* 현재 단계에서 가질 수 있는 최대 텃밭 개수를 반환합니다.
*
* @return 최대 텃밭 개수
*/
public Long getMaxGardens() {
return this.maxGardens;
}
}