From 2e638c4f04a0aeefbf3b9cd13a8dbcf5b3bcb2a5 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Fri, 29 Dec 2023 22:22:25 +0800 Subject: [PATCH] by Robin at 20231229; media fill --- api/proto/feedback/proto/not_null_def_op.go | 2 ++ app/mix/controller/feedback_op.go | 9 +++++++++ dbstruct/feedback.go | 1 + 3 files changed, 12 insertions(+) diff --git a/api/proto/feedback/proto/not_null_def_op.go b/api/proto/feedback/proto/not_null_def_op.go index 1d75cc78..d8a93b0d 100644 --- a/api/proto/feedback/proto/not_null_def_op.go +++ b/api/proto/feedback/proto/not_null_def_op.go @@ -7,6 +7,8 @@ func (p *OpUpdateReq) ProvideNotNullValue() (params []*validator.JsonParam) { params = make([]*validator.JsonParam, 0) params = append(params, validator.NewInt64PtrParam("请提供Id!", p.Feedback.Id)) + params = append(params, validator.NewInt64PtrParam("请更新反馈状态!", p.Feedback.Status)) + params = append(params, validator.NewStringPtrParam("请提供更新备注!", p.Feedback.Remarks)) return } diff --git a/app/mix/controller/feedback_op.go b/app/mix/controller/feedback_op.go index 0c8a7be2..26ac4863 100644 --- a/app/mix/controller/feedback_op.go +++ b/app/mix/controller/feedback_op.go @@ -7,6 +7,7 @@ import ( "service/app/mix/service" "service/bizcommon/util" "service/library/logger" + "service/library/mediafiller" "github.com/gin-gonic/gin" ) @@ -62,6 +63,14 @@ func OpGetFeedbackList(ctx *gin.Context) { return } + //填充媒体切片 + objectMediaNum := 1 // 单个反馈总共1个媒体类 + mediaFillableList := make([]mediafiller.MediaFillable, len(list)*objectMediaNum) + for i, feedback := range list { + mediaFillableList[objectMediaNum*i+0] = feedback.Credentials + } + mediafiller.FillList(ctx, mediaFillableList) + data := &feedbackproto.OpListData{ List: list, Offset: req.Offset + len(list), diff --git a/dbstruct/feedback.go b/dbstruct/feedback.go index 77f88e15..4c72e5fe 100644 --- a/dbstruct/feedback.go +++ b/dbstruct/feedback.go @@ -6,6 +6,7 @@ type Feedback struct { Discription *string `json:"discription" bson:"discription"` // 问题描述 Credentials *MediaComponent `json:"credentials" bson:"credentials"` // 问题凭证 Status *int64 `json:"status" bson:"status"` // 问题状态 + Remarks *string `json:"remarks" bson:"remarks"` // 备注 Ct *int64 `json:"ct" bson:"ct"` // 创建时间 Ut *int64 `json:"ut" bson:"ut"` // 更新时间 DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记