新增currentDay处理
This commit is contained in:
parent
f1228d27a8
commit
ec14ac9fd7
@ -12,6 +12,8 @@ import com.red.circle.other.infra.database.cache.service.other.CheckInCacheServi
|
||||
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -35,9 +37,13 @@ public class CheckInRewardQryExe {
|
||||
.listActivityResource(cmd.requireReqSysOriginEnum(),
|
||||
activityType));
|
||||
|
||||
String dailyKey = CheckInKeys.AZIZI_CHECK_IN.getKey("AZIZI_CHECK_IN" + cmd.getReqUserId() + ZonedDateTimeAsiaRiyadhUtils.nowDateToInt());
|
||||
Boolean checkIn = checkInCacheService.checkDailyCheckIn(cmd.getReqUserId(), dailyKey);
|
||||
Integer days = Optional.ofNullable(checkInCacheService.getCheckInDays(buildKey(cmd.getReqUserId(), activityType.name()))).orElse(0);
|
||||
|
||||
return new CheckInRewardListCO()
|
||||
.setDays(Optional.ofNullable(checkInCacheService.getCheckInDays(buildKey(cmd.getReqUserId(), activityType.name())))
|
||||
.orElse(0))
|
||||
.setDays(days)
|
||||
.setCurrentDay(checkIn ? days : Math.min(days + 1, 7) )
|
||||
.setRewards(rewards);
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,11 @@ public class CheckInRewardListCO extends ClientObject {
|
||||
*/
|
||||
private Integer days;
|
||||
|
||||
/**
|
||||
* 当前天数
|
||||
*/
|
||||
private Integer currentDay;
|
||||
|
||||
|
||||
/**
|
||||
* 打卡奖励列表
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user