f
This commit is contained in:
37
internal/infrastructure/http/routes/ai_product_routes.go
Normal file
37
internal/infrastructure/http/routes/ai_product_routes.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"tyapi-server/internal/infrastructure/http/handlers"
|
||||
sharedhttp "tyapi-server/internal/shared/http"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// AIProductRoutes AI产品接口路由
|
||||
type AIProductRoutes struct {
|
||||
productHandler *handlers.ProductHandler
|
||||
logger *zap.Logger
|
||||
}
|
||||
|
||||
// NewAIProductRoutes 创建AI产品路由
|
||||
func NewAIProductRoutes(
|
||||
productHandler *handlers.ProductHandler,
|
||||
logger *zap.Logger,
|
||||
) *AIProductRoutes {
|
||||
return &AIProductRoutes{
|
||||
productHandler: productHandler,
|
||||
logger: logger,
|
||||
}
|
||||
}
|
||||
|
||||
// Register 注册AI产品相关路由
|
||||
func (r *AIProductRoutes) Register(router *sharedhttp.GinRouter) {
|
||||
engine := router.GetEngine()
|
||||
|
||||
aiProducts := engine.Group("/api/v1/ai/products")
|
||||
{
|
||||
aiProducts.GET("", r.productHandler.ListProductsForAI)
|
||||
}
|
||||
|
||||
r.logger.Info("AI产品路由注册完成")
|
||||
}
|
||||
Reference in New Issue
Block a user