package controller

import (
	"github.com/gofiber/fiber/v2"
	"github.com/rs/zerolog"

	"web-qudo-be/app/module/cms_media/service"
)

type CmsMediaController struct {
	svc *service.CmsMediaService
	Log zerolog.Logger
}

func NewCmsMediaController(svc *service.CmsMediaService, log zerolog.Logger) *CmsMediaController {
	return &CmsMediaController{svc: svc, Log: log}
}

// Viewer streams CMS media from MinIO via API URL (for img/video src).
// @Router /cms-media/viewer/{path} [get]
func (ctrl *CmsMediaController) Viewer(c *fiber.Ctx) error {
	return ctrl.svc.Viewer(c)
}
