From b4400a06b5f801bc7a85320680d0b6c45c547ff0 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期五, 28 七月 2023 10:21:33 +0800 Subject: [PATCH] fix --- api/v1/followRecord.go | 51 +++++++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 24 deletions(-) diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go index 852cb90..e6c2f4c 100644 --- a/api/v1/followRecord.go +++ b/api/v1/followRecord.go @@ -43,30 +43,6 @@ ctx.Ok() } -// List -// -// @Tags FollowRecord -// @Summary 鑾峰彇璺熻繘璁板綍鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.FollowRecordResponse} -// @Router /api/followRecord/list [get] -func (fr *FollowRecordApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - errCode, followRecordList := followRecordService.GetFollowRecordList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.FollowRecordResponse{ - List: followRecordList, - }) -} - // Delete // // @Tags FollowRecord @@ -219,3 +195,30 @@ return time.Time{}, err } + +// List +// +// @Tags FollowRecord +// @Summary 鍥炶璁板綍鍒楄〃 +// @Produce application/json +// @Param object body request.GetFollowRecordList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.FollowRecordResponse} +// @Router /api/followRecord/list [post] +func (fr *FollowRecordApi) List(c *gin.Context) { + var params request.GetFollowRecordList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + followRecords, total, errCode := followRecordService.GetFollowRecordList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.FollowRecordResponse{ + List: followRecords, + Count: int(total), + }) +} \ No newline at end of file -- Gitblit v1.8.0