道具列表增加秒数倒计时

This commit is contained in:
tianfeng 2025-11-06 20:20:35 +08:00
parent 898d1e593e
commit 6852740236
2 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,10 @@ import com.red.circle.other.infra.database.rds.entity.props.PropCouponDO;
import com.red.circle.other.infra.database.rds.entity.props.PropCouponUseRecordDO; import com.red.circle.other.infra.database.rds.entity.props.PropCouponUseRecordDO;
import com.red.circle.other.infra.utils.ZonedDateTimeUtils; import com.red.circle.other.infra.utils.ZonedDateTimeUtils;
import java.sql.Timestamp;
import java.time.Duration;
import java.time.LocalDateTime;
/** /**
* 道具券对象转换器 * 道具券对象转换器
* *
@ -40,7 +44,9 @@ public class PropCouponConvertor {
co.setSource(propCoupon.getSource().getCode()); co.setSource(propCoupon.getSource().getCode());
co.setSourceName(propCoupon.getSource().getDesc()); co.setSourceName(propCoupon.getSource().getDesc());
co.setExpireTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getExpireTime())); Timestamp timestamp = ZonedDateTimeUtils.toTimestamp(propCoupon.getExpireTime());
co.setExpireTime(timestamp);
co.setExpireSeconds(Math.abs(Duration.between(propCoupon.getExpireTime(), LocalDateTime.now()).getSeconds()));
co.setUseTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getUseTime())); co.setUseTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getUseTime()));
co.setCreateTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getCreateTime())); co.setCreateTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getCreateTime()));

View File

@ -75,6 +75,11 @@ public class PropCouponCO {
*/ */
private String sourceName; private String sourceName;
/**
* 过期秒数
*/
private Long expireSeconds;
/** /**
* 过期时间 * 过期时间
*/ */