feat(questions): make brand questions the primary monitoring & template axis
- add /questions/combination-fill endpoint with AI-driven, IP-region-aware matrix fill - extract ip2region resolver from ops/app into shared/ipregion for cross-service use - thread question_id filter through dashboard composite, citation summary, and collect-now - switch template wizard from keyword inputs to brand-question selection (primary + supplemental) - pass brand_question and supplemental_questions through assist/title/outline prompts - add AiWaitingModal + 45s client timeout and request_timeout error mapping for long AI flows Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
sharedbootstrap "github.com/geo-platform/tenant-api/internal/shared/bootstrap"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/cache"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/config"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/ipregion"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/llm"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/messaging/rabbitmq"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/middleware"
|
||||
@@ -55,6 +56,7 @@ type App struct {
|
||||
DesktopTaskStreams *stream.DesktopTaskHub
|
||||
DesktopDispatch *stream.DesktopDispatchHub
|
||||
Cache cache.Cache
|
||||
IPRegions *ipregion.Resolver
|
||||
BrandService *tenantapp.BrandService
|
||||
QuestionExpansion *tenantapp.QuestionExpansionService
|
||||
MonitoringService *tenantapp.MonitoringService
|
||||
@@ -145,8 +147,14 @@ func New(configPath string) (*App, error) {
|
||||
L1TTL: cfg.Cache.L1TTL,
|
||||
DeleteScanCount: cfg.Cache.DeleteScanCount,
|
||||
})
|
||||
ipRegions, err := ipregion.NewResolver(cfg.IPRegion.V4XDBPath, cfg.IPRegion.V6XDBPath, logger)
|
||||
if err != nil {
|
||||
logger.Warn("ip region resolver unavailable; location-aware defaults will be degraded", zap.Error(err))
|
||||
}
|
||||
brandService := tenantapp.NewBrandService(pool, monitoringPool, auditLogs, cfg.BrandLibrary).WithCache(appCache)
|
||||
questionExpansion := tenantapp.NewQuestionExpansionService(pool, llmClient, brandService).WithCache(appCache)
|
||||
questionExpansion := tenantapp.NewQuestionExpansionService(pool, llmClient, brandService).
|
||||
WithCache(appCache).
|
||||
WithIPRegionResolver(ipRegions)
|
||||
monitoringService := tenantapp.NewMonitoringService(pool, monitoringPool, mqClient, cfg.MonitoringDispatch, cfg.BrandLibrary, logger).WithRedis(rdb)
|
||||
kolProfiles := repository.NewKolProfileRepository(pool)
|
||||
kolPackages := repository.NewKolPackageRepository(pool)
|
||||
@@ -215,6 +223,7 @@ func New(configPath string) (*App, error) {
|
||||
DesktopTaskStreams: desktopTaskStreams,
|
||||
DesktopDispatch: desktopDispatch,
|
||||
Cache: appCache,
|
||||
IPRegions: ipRegions,
|
||||
BrandService: brandService,
|
||||
QuestionExpansion: questionExpansion,
|
||||
MonitoringService: monitoringService,
|
||||
@@ -309,6 +318,9 @@ func (a *App) Close() {
|
||||
}
|
||||
cancel()
|
||||
}
|
||||
if a.IPRegions != nil {
|
||||
a.IPRegions.Close()
|
||||
}
|
||||
a.DB.Close()
|
||||
if a.MonitoringDB != nil {
|
||||
a.MonitoringDB.Close()
|
||||
|
||||
Reference in New Issue
Block a user