From 9e46ae0d89e819baf7886288cab0d6dca791af21 Mon Sep 17 00:00:00 2001 From: dlcios Date: Wed, 22 Nov 2023 11:48:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E5=88=97=E8=A1=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=BD=93=E5=89=8D=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v1/visitor.go | 7 ++++--- internal/service/visitor.go | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/api/v1/visitor.go b/api/v1/visitor.go index 5c836af..ab7b2b2 100644 --- a/api/v1/visitor.go +++ b/api/v1/visitor.go @@ -53,7 +53,8 @@ type VisitorListReq struct { } type VisitorListRes struct { - g.Meta `mime:"text/html" example:"string"` - List []*entity.VisitorRecord `json:"list"` - Total int `json:"total"` + g.Meta `mime:"text/html" example:"string"` + List []*entity.VisitorRecord `json:"list"` + Current int `json:"current"` + Total int `json:"total"` } diff --git a/internal/service/visitor.go b/internal/service/visitor.go index 6dcc28c..a55375c 100644 --- a/internal/service/visitor.go +++ b/internal/service/visitor.go @@ -71,8 +71,9 @@ func (s *visitorService) VisitorList(ctx context.Context, req *v1.VisitorListReq } res = &v1.VisitorListRes{ - List: records, - Total: total, + List: records, + Total: total, + Current: req.PageNum, } return