package banner

import (
	"net/http"

	"sundynix-micro-go/app/plant/api/internal/logic/banner"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/common/response"
)

// 启用的Banner列表（客户端）
func GetActiveBannerListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := banner.NewGetActiveBannerListLogic(r.Context(), svcCtx)
		resp, err := l.GetActiveBannerList()
		if err != nil {
			response.Fail(w, err.Error())
		} else {
			response.OkWithData(w, resp)
		}
	}
}
