acquirer_student_add_handler.go 687 B

1234567891011121314151617181920212223242526272829
  1. package acquirer_student
  2. import (
  3. "git.i2edu.net/i2/i2-bill-api/internal/logic/acquirer_student"
  4. "net/http"
  5. "git.i2edu.net/i2/i2-bill-api/internal/svc"
  6. "git.i2edu.net/i2/i2-bill-api/internal/types"
  7. "git.i2edu.net/i2/go-zero/rest/httpx"
  8. )
  9. func AcquirerStudentAddHandler(ctx *svc.ServiceContext) http.HandlerFunc {
  10. return func(w http.ResponseWriter, r *http.Request) {
  11. var req types.EnrollAddReq
  12. if err := httpx.Parse(r, &req); err != nil {
  13. httpx.Error(w, err)
  14. return
  15. }
  16. l := acquirer_student.NewAcquirerStudentAddLogic(r.Context(), ctx)
  17. resp, err := l.AcquirerStudentAdd(req)
  18. if err != nil {
  19. httpx.Error(w, err)
  20. } else {
  21. httpx.OkJson(w, resp)
  22. }
  23. }
  24. }