From cdb6cf78073e06ac2c1fa06f6294967d290c7373 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 20 Jun 2025 16:39:38 +0800 Subject: [PATCH] . --- pkg/dal/core/core_biz.go | 11 ++++++++++- pkg/proto/proto_biz.go | 12 ++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pkg/dal/core/core_biz.go b/pkg/dal/core/core_biz.go index 81eec8f..29b7d1c 100644 --- a/pkg/dal/core/core_biz.go +++ b/pkg/dal/core/core_biz.go @@ -948,12 +948,21 @@ func (m *BizCore) NewsAsyncBatch(ctx *itypes.Context, req *proto.NewsAsyncBatchR } func (m *BizCore) NewsPullNew(ctx *itypes.Context, req *proto.NewsPullNewReq) (resp *proto.NewsPullNewResp, total int64, code itypes.BizCode) { + // 1. 提取 OrgIDs + orgIDs := make([]int64, 0, len(req.List)) + for _, item := range req.List { + orgIDs = append(orgIDs, item.OrgID) + } + + // 2. 调用 DAO 查询 dos, total, err := m.newsDAO.QueryPullNew(&dao.NewsPullNewCondition{ - OrgIDs: req.OrgIDs, + OrgIDs: orgIDs, }) if err != nil { return nil, 0, itypes.NewBizCodeDatabaseError(err.Error()) } + + // 3. 返回结果 return &proto.NewsPullNewResp{ List: dos, }, total, itypes.BizOK diff --git a/pkg/proto/proto_biz.go b/pkg/proto/proto_biz.go index c1e0e20..44487b3 100644 --- a/pkg/proto/proto_biz.go +++ b/pkg/proto/proto_biz.go @@ -293,9 +293,17 @@ type NewsAsyncResp struct { List []*models.NewsDO `json:"list"` } +// type NewsPullNewReq struct { +// OrgIDs []int64 `json:"org_ids"` +// Digest string `json:"digest"` +// } + +type NewsPullNewItem struct { + OrgID int64 `json:"org_id"` + Digest string `json:"digest"` +} type NewsPullNewReq struct { - OrgIDs []int64 `json:"org_ids"` - Digest string `json:"digest"` + List []NewsPullNewItem `json:"list"` } type NewsPullNewResp struct {