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()}) }