package auth

import (
	"net/http"

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

func HelloHandler(ctx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := auth.NewHelloLogic(r.Context(), ctx)
		err := l.Hello()
		if err != nil {
			httpx.Error(w, err)
		} else {
			httpx.Ok(w)
		}
	}
}
