-
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.
- Loading branch information
1 parent
d45c350
commit 0a88cf6
Showing
15 changed files
with
313 additions
and
60 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
13 changes: 13 additions & 0 deletions
13
...ykuround/playkuroundserver/domain/badge/application/attendance_badge/AttendanceBadge.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,13 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public interface AttendanceBadge { | ||
|
||
boolean supports(Set<BadgeType> userBadgeSet, User user); | ||
|
||
BadgeType getBadgeType(); | ||
} |
20 changes: 20 additions & 0 deletions
20
...ound/playkuroundserver/domain/badge/application/attendance_badge/AttendanceBadgeList.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,20 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
public class AttendanceBadgeList { | ||
|
||
@Getter | ||
private final static List<AttendanceBadge> attendanceBadges = List.of( | ||
new Attendance_1(), | ||
new Attendance_5(), | ||
new Attendance_10(), | ||
new Attendance_30(), | ||
new Attendance_100() | ||
); | ||
|
||
private AttendanceBadgeList() { | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...playkuround/playkuroundserver/domain/badge/application/attendance_badge/Attendance_1.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public class Attendance_1 implements AttendanceBadge { | ||
|
||
Attendance_1() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet, User user) { | ||
BadgeType badgeType = getBadgeType(); | ||
return !userBadgeSet.contains(badgeType) && user.getAttendanceDays() >= 1; | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_1; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...laykuround/playkuroundserver/domain/badge/application/attendance_badge/Attendance_10.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public class Attendance_10 implements AttendanceBadge { | ||
|
||
Attendance_10() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet, User user) { | ||
BadgeType badgeType = getBadgeType(); | ||
return !userBadgeSet.contains(badgeType) && user.getAttendanceDays() >= 10; | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_10; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...aykuround/playkuroundserver/domain/badge/application/attendance_badge/Attendance_100.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public class Attendance_100 implements AttendanceBadge { | ||
|
||
Attendance_100() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet, User user) { | ||
BadgeType badgeType = getBadgeType(); | ||
return !userBadgeSet.contains(badgeType) && user.getAttendanceDays() >= 100; | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_100; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...laykuround/playkuroundserver/domain/badge/application/attendance_badge/Attendance_30.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public class Attendance_30 implements AttendanceBadge { | ||
|
||
Attendance_30() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet, User user) { | ||
BadgeType badgeType = getBadgeType(); | ||
return !userBadgeSet.contains(badgeType) && user.getAttendanceDays() >= 30; | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_30; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...playkuround/playkuroundserver/domain/badge/application/attendance_badge/Attendance_5.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.attendance_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.domain.user.domain.User; | ||
|
||
import java.util.Set; | ||
|
||
public class Attendance_5 implements AttendanceBadge { | ||
|
||
Attendance_5() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet, User user) { | ||
BadgeType badgeType = getBadgeType(); | ||
return !userBadgeSet.contains(badgeType) && user.getAttendanceDays() >= 5; | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_5; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...laykuround/playkuroundserver/domain/badge/application/specialday_badge/ArborDayBadge.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.global.util.DateUtils; | ||
|
||
import java.util.Set; | ||
|
||
public class ArborDayBadge implements SpecialDayBadge { | ||
|
||
ArborDayBadge() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet) { | ||
BadgeType badgeType = getBadgeType(); | ||
return DateUtils.isTodayArborDay() && !userBadgeSet.contains(badgeType); | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_ARBOR_DAY; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...kuround/playkuroundserver/domain/badge/application/specialday_badge/ChildrenDayBadge.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.global.util.DateUtils; | ||
|
||
import java.util.Set; | ||
|
||
public class ChildrenDayBadge implements SpecialDayBadge { | ||
|
||
ChildrenDayBadge() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet) { | ||
BadgeType badgeType = getBadgeType(); | ||
return DateUtils.isTodayChildrenDay() && !userBadgeSet.contains(badgeType); | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_CHILDREN_DAY; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...playkuround/playkuroundserver/domain/badge/application/specialday_badge/DuckDayBadge.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.global.util.DateUtils; | ||
|
||
import java.util.Set; | ||
|
||
public class DuckDayBadge implements SpecialDayBadge { | ||
|
||
DuckDayBadge() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet) { | ||
BadgeType badgeType = getBadgeType(); | ||
return DateUtils.isTodayDuckDay() && !userBadgeSet.contains(badgeType); | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_DUCK_DAY; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...round/playkuroundserver/domain/badge/application/specialday_badge/FoundationDayBadge.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,23 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
import com.playkuround.playkuroundserver.global.util.DateUtils; | ||
|
||
import java.util.Set; | ||
|
||
public class FoundationDayBadge implements SpecialDayBadge { | ||
|
||
FoundationDayBadge() { | ||
} | ||
|
||
@Override | ||
public boolean supports(Set<BadgeType> userBadgeSet) { | ||
BadgeType badgeType = getBadgeType(); | ||
return DateUtils.isTodayFoundationDay() && !userBadgeSet.contains(badgeType); | ||
} | ||
|
||
@Override | ||
public BadgeType getBadgeType() { | ||
return BadgeType.ATTENDANCE_FOUNDATION_DAY; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ykuround/playkuroundserver/domain/badge/application/specialday_badge/SpecialDayBadge.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,12 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import com.playkuround.playkuroundserver.domain.badge.domain.BadgeType; | ||
|
||
import java.util.Set; | ||
|
||
public interface SpecialDayBadge { | ||
|
||
boolean supports(Set<BadgeType> userBadgeSet); | ||
|
||
BadgeType getBadgeType(); | ||
} |
20 changes: 20 additions & 0 deletions
20
...ound/playkuroundserver/domain/badge/application/specialday_badge/SpecialDayBadgeList.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,20 @@ | ||
package com.playkuround.playkuroundserver.domain.badge.application.specialday_badge; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
public class SpecialDayBadgeList { | ||
|
||
@Getter | ||
private final static List<SpecialDayBadge> specialDayBadges = List.of( | ||
new FoundationDayBadge(), | ||
new ArborDayBadge(), | ||
new ChildrenDayBadge(), | ||
new DuckDayBadge(), | ||
new WhiteDayBadge() | ||
); | ||
|
||
private SpecialDayBadgeList() { | ||
} | ||
} |
Oops, something went wrong.