feat(workspace): replace supported platform count with bound media account count
The "platforms" stat tile was a constant (5) that never reflected what the tenant actually had set up. Drop SupportedPlatformCount from the workspace overview API/domain/shared-types and have admin-web compute a bound media account count from the desktop accounts list, filtered through a new isMediaPublishAccount helper that excludes deleted rows and AI-only platforms (yuanbao/kimi/wenxin/deepseek/doubao/qwen). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,13 +17,12 @@ import (
|
||||
)
|
||||
|
||||
type WorkspaceService struct {
|
||||
repo repository.WorkspaceRepository
|
||||
templates repository.TemplateRepository
|
||||
quota repository.QuotaRepository
|
||||
aiPointUsage repository.AIPointUsageRepository
|
||||
supportedPlatformCount int
|
||||
cache sharedcache.Cache
|
||||
cacheGroup singleflight.Group
|
||||
repo repository.WorkspaceRepository
|
||||
templates repository.TemplateRepository
|
||||
quota repository.QuotaRepository
|
||||
aiPointUsage repository.AIPointUsageRepository
|
||||
cache sharedcache.Cache
|
||||
cacheGroup singleflight.Group
|
||||
}
|
||||
|
||||
func NewWorkspaceService(
|
||||
@@ -33,11 +32,10 @@ func NewWorkspaceService(
|
||||
aiPointUsage repository.AIPointUsageRepository,
|
||||
) *WorkspaceService {
|
||||
return &WorkspaceService{
|
||||
repo: repo,
|
||||
templates: templates,
|
||||
quota: quota,
|
||||
aiPointUsage: aiPointUsage,
|
||||
supportedPlatformCount: 5,
|
||||
repo: repo,
|
||||
templates: templates,
|
||||
quota: quota,
|
||||
aiPointUsage: aiPointUsage,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,12 +59,10 @@ func (s *WorkspaceService) Overview(ctx context.Context) (*domain.WorkspaceOverv
|
||||
if err != nil {
|
||||
return nil, response.ErrInternal(50010, "query_failed", "failed to count brands")
|
||||
}
|
||||
|
||||
return &domain.WorkspaceOverview{
|
||||
ArticleCount: articleCount,
|
||||
PublishedCount: publishedCount,
|
||||
BrandCount: brandCount,
|
||||
SupportedPlatformCount: s.supportedPlatformCount,
|
||||
ArticleCount: articleCount,
|
||||
PublishedCount: publishedCount,
|
||||
BrandCount: brandCount,
|
||||
}, nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ type WorkspaceOverview struct {
|
||||
ArticleCount int64 `json:"article_count"`
|
||||
PublishedCount int64 `json:"published_count"`
|
||||
BrandCount int64 `json:"brand_count"`
|
||||
SupportedPlatformCount int `json:"supported_platform_count"`
|
||||
}
|
||||
|
||||
type RecentArticle struct {
|
||||
|
||||
Reference in New Issue
Block a user