From f9fcc225f6717d73ab5503c9eb48805d13fa67b1 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Tue, 13 Jun 2023 10:54:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=86=85=E9=83=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A4=9A=E5=8A=A0=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv/cp_cv/cp.go | 2 ++ route/user_r/inner.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cv/cp_cv/cp.go b/cv/cp_cv/cp.go index 4525dd3..7978fd3 100644 --- a/cv/cp_cv/cp.go +++ b/cv/cp_cv/cp.go @@ -7,6 +7,8 @@ type CvCp struct { CpUserInfo *user_cv.CvUserBase `json:"cpUserInfo"` // cp用户信息 CpLevel CvCpLevel `json:"cpLevel"` // cp等级 MyPrivilegeList []CvPrivilege `json:"myPrivilegeList"` // 等级特权 + CreatedUnix int64 `json:"createdUnix"` // cp创建时间 + CpDays int `json:"cpDays"` // cp天数 } // cp关系 diff --git a/route/user_r/inner.go b/route/user_r/inner.go index 24d4cfb..1fe9ea3 100644 --- a/route/user_r/inner.go +++ b/route/user_r/inner.go @@ -157,6 +157,8 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) { Level: cpLevel, }, MyPrivilegeList: myPrivilegeList, + CpDays: int(time.Now().Sub(cpRelation.CreatedTime).Hours()/24) + 1, + CreatedUnix: cpRelation.CreatedTime.Unix(), } resp.ResponseOk(c, response) return myContext, nil -- 2.22.0