diff --git a/build.gradle b/build.gradle index 770e43e..4f04f41 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.1.11' - id 'io.spring.dependency-management' version '1.1.4' + id 'io.spring.dependency-management' version '1.1.6' } group = 'treehouse' diff --git a/src/main/java/treehouse/server/api/user/presentation/dto/UserRequestDTO.java b/src/main/java/treehouse/server/api/user/presentation/dto/UserRequestDTO.java index dfde95f..cc3c808 100644 --- a/src/main/java/treehouse/server/api/user/presentation/dto/UserRequestDTO.java +++ b/src/main/java/treehouse/server/api/user/presentation/dto/UserRequestDTO.java @@ -14,7 +14,9 @@ public static class checkName { @Getter public static class registerUser { + @NotBlank(message = "전화번호를 입력해주세요.") private String phoneNumber; + @NotBlank(message = "유저이름(고유)을 입력해주세요.") private String userName; } diff --git a/src/main/java/treehouse/server/global/entity/User/User.java b/src/main/java/treehouse/server/global/entity/User/User.java index 66c8d16..1e9bb7b 100644 --- a/src/main/java/treehouse/server/global/entity/User/User.java +++ b/src/main/java/treehouse/server/global/entity/User/User.java @@ -47,6 +47,8 @@ public class User extends BaseDateTimeEntity { private Integer activeRate = 0; //활동량 @Builder.Default private Integer invitationCount = 3; //남아있는 초대장의 개수 + @Builder.Default + private Integer invitationCreatedCount = 0; //초대장 생성 횟수 // 탈퇴일자 필요한지 확인하기 @@ -76,5 +78,15 @@ public boolean updatePushAgree(boolean pushAgree){ public void reduceInvitationCount() { this.invitationCount--; + this.invitationCreatedCount++; // 초대장 생성 횟수 증가 + checkAndIncreaseInvitationCount(); // 3회마다 invitationCount 증가 + } + + // 초대 횟수가 3번째일 때만 invitationCount 1 증가 + private void checkAndIncreaseInvitationCount() { + if (this.invitationCreatedCount == 3) { + this.invitationCount++; // 3번째일 때만 증가 + this.invitationCreatedCount = 0; // 카운트 초기화 + } } } \ No newline at end of file