访客列表返回当前页

master
dlcios 10 months ago
parent ac9e974332
commit 9e46ae0d89
  1. 7
      api/v1/visitor.go
  2. 5
      internal/service/visitor.go

@ -53,7 +53,8 @@ type VisitorListReq struct {
} }
type VisitorListRes struct { type VisitorListRes struct {
g.Meta `mime:"text/html" example:"string"` g.Meta `mime:"text/html" example:"string"`
List []*entity.VisitorRecord `json:"list"` List []*entity.VisitorRecord `json:"list"`
Total int `json:"total"` Current int `json:"current"`
Total int `json:"total"`
} }

@ -71,8 +71,9 @@ func (s *visitorService) VisitorList(ctx context.Context, req *v1.VisitorListReq
} }
res = &v1.VisitorListRes{ res = &v1.VisitorListRes{
List: records, List: records,
Total: total, Total: total,
Current: req.PageNum,
} }
return return

Loading…
Cancel
Save