|
|
|
@@ -173,6 +173,29 @@ func SetApiRouter(router *gin.Engine) { |
|
|
|
optionRoute.POST("/migrate_console_setting", controller.MigrateConsoleSetting) // 用于迁移检测的旧键,下个版本会删除 |
|
|
|
} |
|
|
|
|
|
|
|
// 渠道定价路由(管理员权限) |
|
|
|
channelPricingRoute := apiRouter.Group("/channel_pricing") |
|
|
|
channelPricingRoute.Use(middleware.AdminAuth()) |
|
|
|
{ |
|
|
|
channelPricingRoute.GET("/", controller.GetAllChannelPricing) |
|
|
|
channelPricingRoute.GET("/with_tags", controller.GetChannelPricingWithTags) |
|
|
|
channelPricingRoute.GET("/model/:name", controller.GetChannelPricingByModel) |
|
|
|
channelPricingRoute.POST("/", controller.CreateChannelPricing) |
|
|
|
channelPricingRoute.POST("/batch", controller.BatchCreateChannelPricing) |
|
|
|
channelPricingRoute.POST("/copy_global/:channel_id", controller.CopyGlobalPricing) |
|
|
|
channelPricingRoute.DELETE("/:id", controller.DeleteChannelPricing) |
|
|
|
} |
|
|
|
|
|
|
|
// 定价标签路由(管理员权限) |
|
|
|
pricingTagRoute := apiRouter.Group("/pricing_tag") |
|
|
|
pricingTagRoute.Use(middleware.AdminAuth()) |
|
|
|
{ |
|
|
|
pricingTagRoute.GET("/", controller.GetAllPricingTags) |
|
|
|
pricingTagRoute.POST("/", controller.CreatePricingTag) |
|
|
|
pricingTagRoute.PUT("/:id", controller.UpdatePricingTag) |
|
|
|
pricingTagRoute.DELETE("/:id", controller.DeletePricingTag) |
|
|
|
} |
|
|
|
|
|
|
|
// Custom OAuth provider management (root only) |
|
|
|
customOAuthRoute := apiRouter.Group("/custom-oauth-provider") |
|
|
|
customOAuthRoute.Use(middleware.RootAuth()) |
|
|
|
|