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
@@ -55,6 +55,23 @@ func RegisterRoutes(app *bootstrap.App) {
templates.GET("/:id/gen_outline_task_result", tplHandler.GetOutlineTaskResult)
templates.POST("/:id/generate", tplHandler.Generate)
kolManage := protected.Group("/tenant/kol/manage")
kolManageHandler := NewKolManageHandler(app)
kolManage.GET("/profile", kolManageHandler.GetProfile)
kolManage.GET("/packages", kolManageHandler.ListPackages)
kolManage.POST("/packages", kolManageHandler.CreatePackage)
kolManage.PUT("/packages/:id", kolManageHandler.UpdatePackage)
kolManage.DELETE("/packages/:id", kolManageHandler.DeletePackage)
kolManage.PUT("/packages/:id/publish", kolManageHandler.PublishPackage)
kolManage.PUT("/packages/:id/archive", kolManageHandler.ArchivePackage)
kolManage.GET("/packages/:id/prompts", kolManageHandler.ListPrompts)
kolManage.POST("/packages/:id/prompts", kolManageHandler.CreatePrompt)
kolManage.GET("/prompts/:id", kolManageHandler.GetPromptLatest)
kolManage.PUT("/prompts/:id", kolManageHandler.UpdatePromptMetadata)
kolManage.DELETE("/prompts/:id", kolManageHandler.DeletePrompt)
kolManage.POST("/prompts/:id/draft", kolManageHandler.SaveDraft)
kolManage.POST("/prompts/:id/publish", kolManageHandler.PublishPrompt)
articles := protected.Group("/tenant/articles")
artHandler := NewArticleHandler(app)
articles.GET("", artHandler.List)