From bdec888de8026e379b32bddc5f05252c996d0dab Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 5 Sep 2023 09:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8F=91=E5=B8=83=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=82=E5=AE=B6=E4=BF=A1=E6=81=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dto/publishedGi/publishedGi.go | 2 ++ service/publishedGi.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dto/publishedGi/publishedGi.go b/dto/publishedGi/publishedGi.go index 9cde5ab..c12fa31 100644 --- a/dto/publishedGi/publishedGi.go +++ b/dto/publishedGi/publishedGi.go @@ -35,6 +35,7 @@ type PublishedGiDto struct { Proto []byte `json:"proto"` UserID int32 `json:"userID"` Note string `json:"note"` + Category string `json:"category" form:"category"` PublishAt dto.JsonTime `json:"publishAt" time_format:"2006-01-02 15:04:05"` } @@ -45,6 +46,7 @@ func ConvertFrom(gi *model.PublishedGi) *PublishedGiDto { Proto: gi.Proto, Note: gi.Note, UserID: gi.UserID, + Category: gi.Category, PublishAt: dto.JsonTime(gi.PublishAt), } } diff --git a/service/publishedGi.go b/service/publishedGi.go index 4cb2e81..b6d504b 100644 --- a/service/publishedGi.go +++ b/service/publishedGi.go @@ -19,7 +19,7 @@ func PageQueryPublishedGi(req *publishedGi.PublishedGiReqDto) *dto.PageDto { if req.Name != "" { where = where.Where(dp.Name.Like(fmt.Sprintf("%%%s%%", req.Name))) } - result, count, err := where.Select(dp.ID, dp.Name, dp.Note, dp.PublishAt).Debug().FindByPage(req.Offset(), req.Size) + result, count, err := where.Omit(dbquery.PublishedGi.Proto).Debug().FindByPage(req.Offset(), req.Size) if err != nil { panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) }