send_code_t.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package handler
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "youngee_b_api/model/http_model"
  5. )
  6. func WrapSendCodeTHandler(ctx *gin.Context) {
  7. handler := newSendCodeTHandler(ctx)
  8. baseRun(handler)
  9. }
  10. func newSendCodeTHandler(ctx *gin.Context) *SendCodeTHandler {
  11. return &SendCodeTHandler{
  12. req: http_model.NewSendCodeTRequest(),
  13. resp: http_model.NewSendCodeTResponse(),
  14. ctx: ctx,
  15. }
  16. }
  17. type SendCodeTHandler struct {
  18. req *http_model.SendCodeTRequest
  19. resp *http_model.CommonResponse
  20. ctx *gin.Context
  21. }
  22. func (h *SendCodeTHandler) getRequest() interface{} {
  23. return h.req
  24. }
  25. func (h *SendCodeTHandler) getContext() *gin.Context {
  26. return h.ctx
  27. }
  28. func (h *SendCodeTHandler) getResponse() interface{} {
  29. return h.resp
  30. }
  31. func (h *SendCodeTHandler) run() {
  32. // data, err := service.Supplier.SendCodeT(h.ctx, h.req.Phone)
  33. // if err != nil {
  34. // logrus.Errorf("[FindSubAccountByEnterpriseId] call SetSession err:%+v\n", err)
  35. // util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
  36. // h.resp.Message = err.Error()
  37. // h.resp.Status = 40000
  38. // return
  39. // }
  40. // h.resp.Data = data
  41. // h.resp.Status = 20000
  42. // h.resp.Message = "ok"
  43. }
  44. func (h *SendCodeTHandler) checkParam() error {
  45. return nil
  46. }