feat(kol): marketplace + admin subscription HTTP endpoints

This commit is contained in:
2026-04-17 14:23:39 +08:00
parent 99fc6c1af4
commit 2a2489ce5c
4 changed files with 266 additions and 1 deletions
@@ -74,6 +74,24 @@ func RegisterRoutes(app *bootstrap.App) {
kolManage.POST("/assist", kolManageHandler.AssistSubmit)
kolManage.GET("/assist/:id", kolManageHandler.AssistGet)
kolMarketplace := protected.Group("/tenant/kol/marketplace")
kolMarketplaceHandler := NewKolMarketplaceHandler(app)
kolMarketplace.GET("/packages", kolMarketplaceHandler.ListPackages)
kolMarketplace.GET("/packages/:id", kolMarketplaceHandler.GetPackage)
kolMarketplace.POST("/packages/:id/subscribe", kolMarketplaceHandler.Subscribe)
kolSubscriptions := protected.Group("/tenant/kol")
kolSubscriptions.GET("/subscriptions", kolMarketplaceHandler.ListSubscriptions)
kolSubscriptions.GET("/subscription-prompts", kolMarketplaceHandler.ListSubscriptionPrompts)
// V1 compromise: these admin operations live on tenant-api and are gated by
// tenant_role=tenant_admin until the platform-api/module is built.
kolAdmin := protected.Group("/tenant/kol/admin")
kolAdminHandler := NewKolAdminHandler(app)
kolAdmin.PUT("/subscriptions/:id/approve", kolAdminHandler.ApproveSubscription)
kolAdmin.POST("/subscriptions", kolAdminHandler.ManualBind)
kolAdmin.PUT("/subscriptions/:id/revoke", kolAdminHandler.RevokeSubscription)
articles := protected.Group("/tenant/articles")
artHandler := NewArticleHandler(app)
articles.GET("", artHandler.List)