重构路由注册功能

This commit is contained in:
GeekMaster
2025-07-31 12:05:31 +08:00
parent 9fba68fb14
commit 0ee230cf41
46 changed files with 447 additions and 223 deletions

View File

@@ -43,6 +43,18 @@ func NewSunoHandler(app *core.AppServer, db *gorm.DB, service *suno.Service, upl
}
}
// RegisterRoutes 注册路由
func (h *SunoHandler) RegisterRoutes() {
group := h.App.Engine.Group("/api/suno")
group.POST("create", h.Create)
group.GET("list", h.List)
group.GET("remove", h.Remove)
group.GET("publish", h.Publish)
group.POST("update", h.Update)
group.GET("detail", h.Detail)
group.GET("play", h.Play)
}
func (h *SunoHandler) Create(c *gin.Context) {
var data struct {