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:
jackyu66git
2026-08-13 20:02:01 +08:00
co-authored by Cursor
parent 655141980a
commit 56f661748a
27 changed files with 773 additions and 25 deletions
+18
View File
@@ -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)