package handler

import (
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"
	"jyBXBase/api/internal/logic"
	"jyBXBase/api/internal/svc"
	"jyBXBase/api/internal/types"
)

func CheckSearchScreenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		var req types.AddSearchScreen
		if err := httpx.Parse(r, &req); err != nil {
			httpx.Error(w, err)
			return
		}

		l := logic.NewCheckSearchScreenLogic(r.Context(), svcCtx, r)
		resp, err := l.CheckSearchScreen(&req)
		if err != nil {
			httpx.Error(w, err)
		} else {
			httpx.OkJson(w, resp)
		}
	}
}
