From 68527402366f71f73b3fc94fca9df1ba9f3909c5 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 6 Nov 2025 20:20:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A7=92=E6=95=B0=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/other/app/convertor/PropCouponConvertor.java | 8 +++++++- .../circle/other/app/dto/clientobject/PropCouponCO.java | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/PropCouponConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/PropCouponConvertor.java index 41bac69f..e8eb47f5 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/PropCouponConvertor.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/PropCouponConvertor.java @@ -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.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.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.setCreateTime(ZonedDateTimeUtils.toTimestamp(propCoupon.getCreateTime())); diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/PropCouponCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/PropCouponCO.java index 16ae3fe5..fb6977bd 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/PropCouponCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/PropCouponCO.java @@ -75,6 +75,11 @@ public class PropCouponCO { */ private String sourceName; + /** + * 过期秒数 + */ + private Long expireSeconds; + /** * 过期时间 */