feat(kol): KOL workspace HTTP handlers + route registration

This commit is contained in:
2026-04-17 09:19:37 +08:00
parent 6029b0b169
commit a6ded27c1d
3 changed files with 367 additions and 0 deletions
+10
View File
@@ -25,6 +25,7 @@ import (
"github.com/geo-platform/tenant-api/internal/shared/response"
"github.com/geo-platform/tenant-api/internal/shared/retrieval"
"github.com/geo-platform/tenant-api/internal/shared/stream"
tenantapp "github.com/geo-platform/tenant-api/internal/tenant/app"
"github.com/geo-platform/tenant-api/internal/tenant/prompts"
"github.com/geo-platform/tenant-api/internal/tenant/repository"
)
@@ -47,6 +48,9 @@ type App struct {
GenerationStreams *stream.GenerationHub
Cache cache.Cache
KolProfiles repository.KolProfileRepository
KolPackages repository.KolPackageRepository
KolPrompts repository.KolPromptRepository
KolPromptAsset *tenantapp.KolPromptAsset
}
func New(configPath string) (*App, error) {
@@ -99,6 +103,9 @@ func New(configPath string) (*App, error) {
generationStreams := stream.NewGenerationHub(mqClient)
appCache := cache.New(cfg.Cache.Driver, rdb)
kolProfiles := repository.NewKolProfileRepository(pool)
kolPackages := repository.NewKolPackageRepository(pool)
kolPrompts := repository.NewKolPromptRepository(pool)
kolPromptAsset := tenantapp.NewKolPromptAsset(objectStorageClient)
if cfg.Server.Mode == "release" {
gin.SetMode(gin.ReleaseMode)
@@ -153,6 +160,9 @@ func New(configPath string) (*App, error) {
GenerationStreams: generationStreams,
Cache: appCache,
KolProfiles: kolProfiles,
KolPackages: kolPackages,
KolPrompts: kolPrompts,
KolPromptAsset: kolPromptAsset,
}, nil
}