From 0f45a3916c40d0c10e12233cc903af9102422717 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 19 Jun 2025 23:42:12 +0800 Subject: [PATCH] . --- pkg/dal/core/core_biz.go | 13 +++++++++---- pkg/proto/proto_biz.go | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/dal/core/core_biz.go b/pkg/dal/core/core_biz.go index 9994c6d..0cd372e 100644 --- a/pkg/dal/core/core_biz.go +++ b/pkg/dal/core/core_biz.go @@ -898,17 +898,22 @@ func (m *BizCore) TagDelete(ctx *itypes.Context, req *proto.TagDeleteReq) (resp } func (m *BizCore) NewsAsync(ctx *itypes.Context, req *proto.NewsAsyncReq, needExtra bool) (resp *proto.NewsAsyncResp, total int64, code itypes.BizCode) { - var err error - var dos []*models.NewsDO - dos, total, err = m.newsDAO.QueryAsync(&dao.NewsAsyncCondition{ + dos, total, err := m.newsDAO.QueryAsync(&dao.NewsAsyncCondition{ Org_Id: req.Org_Id, Digest: req.Digest, }) if err != nil { return nil, 0, itypes.NewBizCodeDatabaseError(err.Error()) } + + var extra map[string]interface{} + if needExtra && len(dos) > 0 && dos[0].ExtraData != nil { + extra = dos[0].ExtraData + } + return &proto.NewsAsyncResp{ - List: dos, + List: dos, + ExtraData: extra, // ✅ 添加 extra_data 返回 }, total, itypes.BizOK } diff --git a/pkg/proto/proto_biz.go b/pkg/proto/proto_biz.go index 625e87a..0a4e3af 100644 --- a/pkg/proto/proto_biz.go +++ b/pkg/proto/proto_biz.go @@ -286,7 +286,8 @@ type NewsAsyncReq struct { } type NewsAsyncResp struct { - List []*models.NewsDO `json:"list"` + List []*models.NewsDO `json:"list"` + ExtraData map[string]interface{} `json:"extra_data"` // ✅ 添加字段 } type NewsPullNewReq struct {