From 5a89c1c9555a73836f7856517441d36056f6a057 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 15 Jun 2023 18:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- txop/headwear_tx/headwear.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/txop/headwear_tx/headwear.go b/txop/headwear_tx/headwear.go index 4317352..42575ea 100644 --- a/txop/headwear_tx/headwear.go +++ b/txop/headwear_tx/headwear.go @@ -9,6 +9,7 @@ import ( "git.hilo.cn/hilo-common/internal/model/res_m" "git.hilo.cn/hilo-common/internal/model/user_m" "git.hilo.cn/hilo-common/resource/mysql" + "git.hilo.cn/hilo-common/utils" "strconv" "time" ) @@ -29,6 +30,10 @@ func SendHeadwear(model *domain.Model, receiverUserId mysql.ID, headdressId mysq nowTime = userHeadwear.EndTime } userHeadwear.EndTime = nowTime.Add(time.Duration(receiveHeadwearDuration) * time.Second) + maxEndTime, _ := time.ParseInLocation(utils.DATETIME_FORMAT, "2038-01-01 23:59:59", time.Local) + if userHeadwear.EndTime.After(maxEndTime) { + userHeadwear.EndTime = maxEndTime + } if err := userHeadwear.Persistent(); err != nil { return err } -- 2.22.0