package handler import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "youngee_b_api/consts" "youngee_b_api/model/http_model" "youngee_b_api/pack" "youngee_b_api/service" "youngee_b_api/util" ) func WrapSpecialLocalListHandler(ctx *gin.Context) { handler := newSpecialLocalListHandler(ctx) baseRun(handler) } func newSpecialLocalListHandler(ctx *gin.Context) *SpecialLocalListHandler { return &SpecialLocalListHandler{ req: http_model.NewSpecialLocalListRequest(), resp: http_model.NewSpecialLocalListResponse(), ctx: ctx, } } type SpecialLocalListHandler struct { req *http_model.SpecialLocalListRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *SpecialLocalListHandler) getRequest() interface{} { return h.req } func (h *SpecialLocalListHandler) getContext() *gin.Context { return h.ctx } func (h *SpecialLocalListHandler) getResponse() interface{} { return h.resp } func (h *SpecialLocalListHandler) run() { // enterpriseID := middleware.GetSessionAuth(h.ctx).EnterpriseID condition := pack.HttpSpecialLocalLifeListRequestToCondition(h.req) data, err := service.LocalLife.GetSpecialLocalLifeList(h.ctx, h.req.PageSize, h.req.PageNum, condition) if err != nil { logrus.WithContext(h.ctx).Errorf("[FullListHandler] error GetFullProjectList, err:%+v", err) util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast) return } h.resp.Data = data } func (h *SpecialLocalListHandler) checkParam() error { return nil }