feat(ECR-042): OpsCMS FeedSlot 薄写面
Admin POST/PUT 复用 admin.cms.write;C 端 GET /home/feed-slots;首页无 active 槽隐藏推荐区、失败回退展示;无新 migration。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,6 +58,24 @@ func (s *Service) ListPublicBanners(ctx context.Context, placement string) ([]re
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// ListPublicFeedSlots returns active feed slots for placement.
|
||||
func (s *Service) ListPublicFeedSlots(ctx context.Context, placement string) ([]repository.FeedSlotRow, error) {
|
||||
if placement == "" {
|
||||
placement = "home"
|
||||
}
|
||||
if s.CMS == nil {
|
||||
return []repository.FeedSlotRow{}, nil
|
||||
}
|
||||
items, err := s.CMS.ListActiveFeedSlots(ctx, placement)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if items == nil {
|
||||
items = []repository.FeedSlotRow{}
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// ListAdmin returns all tools.
|
||||
func (s *Service) ListAdmin(ctx context.Context) ([]repository.HomeTool, error) {
|
||||
return s.Repo.ListAll(ctx)
|
||||
|
||||
Reference in New Issue
Block a user