package base_organ_school

import (
	"net/http"

	"git.i2edu.net/i2/go-zero/rest/httpx"
	"git.i2edu.net/i2/i2-bill-api/internal/logic/base_organ_school"
	"git.i2edu.net/i2/i2-bill-api/internal/svc"
)

func GetErpSchTreeHandler(ctx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {

		l := base_organ_school.NewGetErpSchTreeLogic(r.Context(), ctx)
		resp, err := l.GetErpSchTree()
		if err != nil {
			httpx.Error(w, err)
		} else {
			httpx.OkJson(w, resp)
		}
	}
}
