package handler import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "youngee_m_api/consts" "youngee_m_api/db" "youngee_m_api/model/http_model" "youngee_m_api/util" ) func WrapGetAllwithdrawValueHandler(ctx *gin.Context) { handler := newGetAllwithdrawValueHandler(ctx) BaseRun(handler) } type GetAllwithdrawValueHandler struct { ctx *gin.Context req *http_model.GetAllwithdrawValueRequest resp *http_model.CommonResponse } func (g GetAllwithdrawValueHandler) getContext() *gin.Context { return g.ctx } func (g GetAllwithdrawValueHandler) getResponse() interface{} { return g.resp } func (g GetAllwithdrawValueHandler) getRequest() interface{} { return g.req } func (g GetAllwithdrawValueHandler) run() { data, err := db.GetAllwithdrawValue(g.ctx) if err != nil { logrus.WithContext(g.ctx).Errorf("[GetAllwithdrawValueHandler] error GetAllwithdrawValue, err:%+v", err) util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast) return } g.resp.Data = data g.resp.Message = "ok" g.resp.Status = consts.ErrorSuccess } func (g GetAllwithdrawValueHandler) checkParam() error { return nil } func newGetAllwithdrawValueHandler(ctx *gin.Context) *GetAllwithdrawValueHandler { return &GetAllwithdrawValueHandler{ ctx: ctx, req: http_model.NewGetAllwithdrawValueRequest(), resp: http_model.NewGetAllwithdrawValueResponse(), } }