From fc7d91ea3a18060bc9aef1324264126ac14af2db Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Wed, 15 Mar 2023 19:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E6=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/utime/utime.go | 11 ++++++----- cv/group_power_cv/groupPower.go | 4 ++-- route/group_power_r/group_power.go | 7 ++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/common/utime/utime.go b/common/utime/utime.go index 4fee746..68a1676 100644 --- a/common/utime/utime.go +++ b/common/utime/utime.go @@ -6,11 +6,12 @@ import ( ) const ( - Day = 86400 - Layout = "2006-01-02 15:04:05" - LayoutDay = "2006-01-02" - LayoutDay2 = "20060102" - LayoutMonth = "2006-01" + Day = 86400 + Layout = "2006-01-02 15:04:05" + LayoutDay = "2006-01-02" + LayoutDay2 = "20060102" + LayoutMonth = "2006-01" + LayoutMinute = "2006-01-02 15:04" ) // 获取时间所在周的第一天(周一) 00:00:00,和最后一天(周日)23:59:59 diff --git a/cv/group_power_cv/groupPower.go b/cv/group_power_cv/groupPower.go index d9521ac..9a5d355 100644 --- a/cv/group_power_cv/groupPower.go +++ b/cv/group_power_cv/groupPower.go @@ -690,14 +690,14 @@ type FamilyMemberDetail struct { type FamilyApplyList struct { User *user_m.UserTiny `json:"user"` - Time time.Time `json:"time"` + Time string `json:"time"` Status int8 `json:"status"` // 0未操作,1已接受,2.已拒绝 MgrName string `json:"mgrName"` // 管理员名称 } type FamilyQuitList struct { User *user_m.UserTiny `json:"user"` - Time time.Time `json:"time"` + Time string `json:"time"` QuitType int8 `json:"status"` // 1.主动退出 2.被踢出 MgrName string `json:"mgrName"` // 管理员名称 } diff --git a/route/group_power_r/group_power.go b/route/group_power_r/group_power.go index 4754794..b52a2b2 100644 --- a/route/group_power_r/group_power.go +++ b/route/group_power_r/group_power.go @@ -14,6 +14,7 @@ import ( "hilo-group/_const/enum/msg_e" "hilo-group/_const/redis_key" "hilo-group/common" + "hilo-group/common/utime" "hilo-group/cv/group_cv" "hilo-group/cv/group_power_cv" "hilo-group/cv/medal_cv" @@ -1094,7 +1095,7 @@ func GroupPowerApplyList(c *gin.Context) (*mycontext.MyContext, error) { result := make([]*group_power_cv.FamilyApplyList, 0, len(rows)) for _, v := range rows { - info := &group_power_cv.FamilyApplyList{User: userMap[v.UserId], Time: v.CreatedTime, Status: v.IsAccept} + info := &group_power_cv.FamilyApplyList{User: userMap[v.UserId], Time: v.CreatedTime.Format(utime.LayoutMinute), Status: v.IsAccept} if v.MgrId > 0 { info.MgrName = userMap[v.MgrId].Nick } @@ -1197,7 +1198,7 @@ func GroupPowerQuit(c *gin.Context) (*mycontext.MyContext, error) { // @Summary 家族退出列表 // @Param pageSize query int true "分页大小 默认:10" default(10) // @Param pageIndex query int true "第几个分页,从1开始 默认:1" default(1) -// @Success 200 +// @Success 200 {object} []group_power_cv.FamilyQuitList // @Router /v1/groupPower/quit/list [get] func GroupPowerQuitList(c *gin.Context) (*mycontext.MyContext, error) { myContext := mycontext.CreateMyContext(c.Keys) @@ -1244,7 +1245,7 @@ func GroupPowerQuitList(c *gin.Context) (*mycontext.MyContext, error) { result := make([]*group_power_cv.FamilyQuitList, 0, len(rows)) for _, v := range rows { - item := &group_power_cv.FamilyQuitList{User: userMap[v.UserId], Time: v.CreatedTime} + item := &group_power_cv.FamilyQuitList{User: userMap[v.UserId], Time: v.CreatedTime.Format(utime.LayoutMinute)} if v.UserId == v.MgrId { item.QuitType = 1 // 主动退出 } else { -- 2.22.0