27 lines
1.0 KiB
Go
27 lines
1.0 KiB
Go
package handlers
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
// @Summary Get virtual game recommendations
|
|
// @Description Returns a list of recommended virtual games for a specific user
|
|
// @Tags Recommendations
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param userID path string true "User ID"
|
|
// @Success 200 {object} map[string]interface{} "Recommended games fetched successfully"
|
|
// @Failure 500 {object} domain.RecommendationErrorResponse "Failed to fetch recommendations"
|
|
// @Router /api/v1/virtual-games/recommendations/{userID} [get]
|
|
func (h *Handler) GetRecommendations(c *fiber.Ctx) error {
|
|
userID := c.Params("userID") // or from JWT
|
|
recommendations, err := h.recommendationSvc.GetRecommendations(c.Context(), userID)
|
|
if err != nil {
|
|
return fiber.NewError(fiber.StatusInternalServerError, "Failed to fetch recommendations")
|
|
}
|
|
return c.JSON(fiber.Map{
|
|
"message": "Recommended games fetched successfully",
|
|
"recommended_games": recommendations,
|
|
})
|
|
}
|