package agent

import (
	"net/http"

	"qnc-server/app/main/api/internal/logic/agent"
	"qnc-server/app/main/api/internal/svc"

	"github.com/zeromicro/go-zero/rest/httpx"
)

func PromotionRedirectHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := agent.NewPromotionRedirectLogic(r.Context(), svcCtx)
		err := l.PromotionRedirect(r, w)
		if err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
		}
	}
}

