From 46ddc68768d8d45b8fc98ac859f73eb067e3c341 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Tue, 13 Jun 2023 18:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=AA=E5=BF=B5=E6=97=A5=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv/cp_cv/anniversary.go | 17 +++++++++-------- domain/model/cp_m/anniversary.go | 4 ++-- route/cp_r/anniversary.go | 20 +++++++++++--------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/cv/cp_cv/anniversary.go b/cv/cp_cv/anniversary.go index 1c503a0..d98252c 100644 --- a/cv/cp_cv/anniversary.go +++ b/cv/cp_cv/anniversary.go @@ -12,12 +12,13 @@ type CvCpBase struct { } type CvCpAnniversary struct { - Type cp_e.AnniversaryItemType `json:"type"` // 列表类型 0:普通 1:头像 - CpInfo *CvCpBase `json:"cpInfo,omitempty"` // cp信息,type=1(头像)时候用到 - Id uint64 `json:"id"` // 记录id - Content string `json:"content"` // 纪念日内容 - Timestamp int64 `json:"timestamp"` // 纪念日时间戳 - IsRemind bool `json:"isRemind"` // 是否提醒 - CanDel bool `json:"canDel"` // 能否删除 - IsTop bool `json:"isTop"` // 是否置顶 + Type cp_e.AnniversaryItemType `json:"type"` // 列表类型 0:普通 1:头像 + CpInfo *CvCpBase `json:"cpInfo,omitempty"` // cp信息,type=1(头像)时候用到 + Id uint64 `json:"id"` // 记录id + Content string `json:"content"` // 纪念日内容 + OriginTimestamp int64 `json:"originTimestamp"` // 纪念日的时间 + Timestamp int64 `json:"timestamp"` // 下次纪念日时间戳 + IsRemind bool `json:"isRemind"` // 是否提醒 + CanDel bool `json:"canDel"` // 能否删除 + IsTop bool `json:"isTop"` // 是否置顶 } diff --git a/domain/model/cp_m/anniversary.go b/domain/model/cp_m/anniversary.go index 648bdf6..80a4c53 100644 --- a/domain/model/cp_m/anniversary.go +++ b/domain/model/cp_m/anniversary.go @@ -34,10 +34,10 @@ func InitCpAnniversary(model *domain.Model, cp CpRelationTmp) error { if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeNormal, cp, "我们在一起", time.Now().Unix(), true, 100); err != nil { return err } - if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeAnniversary, cp, fmt.Sprintf("%s的生日", users[cp.UserId1].Nick), int64(users[cp.UserId1].Birthday), true, 0); err != nil { + if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeAnniversary, cp, fmt.Sprintf("%s的生日", users[cp.UserId1].Nick), 0, true, 0); err != nil { return err } - if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeAnniversary, cp, fmt.Sprintf("%s的生日", users[cp.UserId2].Nick), int64(users[cp.UserId2].Birthday), true, 0); err != nil { + if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeAnniversary, cp, fmt.Sprintf("%s的生日", users[cp.UserId2].Nick), 0, true, 0); err != nil { return err } if err := AddCpAnniversary(model, cp_e.AnniversaryItemTypeNormal, cp, "第一次说我爱你", 0, false, 0); err != nil { diff --git a/route/cp_r/anniversary.go b/route/cp_r/anniversary.go index ff84868..990a100 100644 --- a/route/cp_r/anniversary.go +++ b/route/cp_r/anniversary.go @@ -114,8 +114,9 @@ func PageAnniversary(c *gin.Context) (*mycontext.MyContext, error) { UserInfo: *userInfo, CpUserInfo: *cpUserInfo, }, - Timestamp: cpRelation.CreatedTime.Unix(), - CanDel: false, + OriginTimestamp: cpRelation.CreatedTime.Unix(), + Timestamp: cpRelation.CreatedTime.Unix(), + CanDel: false, }) } anniversary := cp_m.GetAllCpAnniversary(model, userId) @@ -130,13 +131,14 @@ func PageAnniversary(c *gin.Context) (*mycontext.MyContext, error) { Type = cp_e.AnniversaryItemTypeNormal } response = append(response, cp_cv.CvCpAnniversary{ - Type: Type, - Id: v.ID, - Content: v.Content, - Timestamp: timestamp, - IsRemind: v.IsRemind, - CanDel: true, - IsTop: v.Sort > 0, + Type: Type, + Id: v.ID, + Content: v.Content, + Timestamp: timestamp, + OriginTimestamp: v.Timestamp, + IsRemind: v.IsRemind, + CanDel: true, + IsTop: v.Sort > 0, }) } resp.ResponsePageBaseOk(c, response, 0, false) -- 2.22.0