feat: scope articles by brand

This commit is contained in:
2026-05-20 15:37:25 +08:00
parent 5fb9d0b0dd
commit dd082e2ed1
72 changed files with 3213 additions and 432 deletions
+8 -1
View File
@@ -98,9 +98,16 @@ type BrandLibrarySummaryResponse struct {
func (s *BrandService) List(ctx context.Context) ([]BrandResponse, error) {
actor := auth.MustActor(ctx)
return sharedcache.LoadJSON(ctx, s.cache, &s.cacheGroup, brandListCacheKey(actor.TenantID), defaultCacheTTL(), func(loadCtx context.Context) ([]BrandResponse, error) {
brands, err := sharedcache.LoadJSON(ctx, s.cache, &s.cacheGroup, brandListCacheKey(actor.TenantID), defaultCacheTTL(), func(loadCtx context.Context) ([]BrandResponse, error) {
return s.loadBrands(loadCtx, actor.TenantID)
})
if err != nil {
return nil, err
}
if brands == nil {
return []BrandResponse{}, nil
}
return brands, nil
}
func (s *BrandService) Summary(ctx context.Context) (*BrandLibrarySummaryResponse, error) {