feat(ECR-025): OpsCMS FeedSlot 只读并 Closed

栏目位目录(ops_feed_slots + /cms),复用 admin.cms.read。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-08 03:08:40 +08:00
co-authored by Cursor
parent f51b2524c5
commit e32466357d
26 changed files with 661 additions and 4 deletions
+22
View File
@@ -11,6 +11,7 @@ import (
)
var ErrBannerNotFound = errString("banner not found")
var ErrFeedSlotNotFound = errString("feed slot not found")
// ListBanners returns OpsCMS Banner catalog.
func (s *Service) ListBanners(ctx context.Context) ([]repository.BannerRow, error) {
@@ -32,3 +33,24 @@ func (s *Service) GetBanner(ctx context.Context, id uuid.UUID) (*repository.Bann
}
return row, err
}
// ListFeedSlots returns OpsCMS FeedSlot catalog.
func (s *Service) ListFeedSlots(ctx context.Context) ([]repository.FeedSlotRow, error) {
items, err := s.Repo.ListFeedSlots(ctx)
if err != nil {
return nil, err
}
if items == nil {
items = []repository.FeedSlotRow{}
}
return items, nil
}
// GetFeedSlot loads one feed slot.
func (s *Service) GetFeedSlot(ctx context.Context, id uuid.UUID) (*repository.FeedSlotRow, error) {
row, err := s.Repo.GetFeedSlot(ctx, id)
if errors.Is(err, pgx.ErrNoRows) {
return nil, ErrFeedSlotNotFound
}
return row, err
}