hello_handler.go 431 B

123456789101112131415161718192021
  1. package auth
  2. import (
  3. "net/http"
  4. "git.i2edu.net/i2/go-zero/rest/httpx"
  5. "git.i2edu.net/i2/i2-bill-api/internal/logic/auth"
  6. "git.i2edu.net/i2/i2-bill-api/internal/svc"
  7. )
  8. func HelloHandler(ctx *svc.ServiceContext) http.HandlerFunc {
  9. return func(w http.ResponseWriter, r *http.Request) {
  10. l := auth.NewHelloLogic(r.Context(), ctx)
  11. err := l.Hello()
  12. if err != nil {
  13. httpx.Error(w, err)
  14. } else {
  15. httpx.Ok(w)
  16. }
  17. }
  18. }