This commit is contained in:
hailin 2025-06-20 16:39:38 +08:00
parent 681a1607c6
commit cdb6cf7807
2 changed files with 20 additions and 3 deletions

View File

@ -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) { 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{ dos, total, err := m.newsDAO.QueryPullNew(&dao.NewsPullNewCondition{
OrgIDs: req.OrgIDs, OrgIDs: orgIDs,
}) })
if err != nil { if err != nil {
return nil, 0, itypes.NewBizCodeDatabaseError(err.Error()) return nil, 0, itypes.NewBizCodeDatabaseError(err.Error())
} }
// 3. 返回结果
return &proto.NewsPullNewResp{ return &proto.NewsPullNewResp{
List: dos, List: dos,
}, total, itypes.BizOK }, total, itypes.BizOK

View File

@ -293,9 +293,17 @@ type NewsAsyncResp struct {
List []*models.NewsDO `json:"list"` 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 { type NewsPullNewReq struct {
OrgIDs []int64 `json:"org_ids"` List []NewsPullNewItem `json:"list"`
Digest string `json:"digest"`
} }
type NewsPullNewResp struct { type NewsPullNewResp struct {