package handler import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "youngee_b_api/consts" "youngee_b_api/model/http_model" "youngee_b_api/service" "youngee_b_api/util" ) func WrapShowSLocalHandler(ctx *gin.Context) { handler := newShowSLocalHandler(ctx) baseRun(handler) } func newShowSLocalHandler(ctx *gin.Context) *ShowSLocalHandler { return &ShowSLocalHandler{ req: http_model.NewShowSLocalRequest(), resp: http_model.NewShowSLocalResponse(), ctx: ctx, } } type ShowSLocalHandler struct { req *http_model.ShowSLocalRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *ShowSLocalHandler) getRequest() interface{} { return h.req } func (h *ShowSLocalHandler) getContext() *gin.Context { return h.ctx } func (h *ShowSLocalHandler) getResponse() interface{} { return h.resp } func (h *ShowSLocalHandler) run() { res, err := service.SLcoalLife.ShowSLocalLife(h.ctx, h.req) if err != nil { logrus.Errorf("[ShowProjectHandler] call Show err:%+v\n", err) util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "") log.Info("ShowProject fail,req:%+v", h.req) return } h.resp.Message = "成功查询项目" h.resp.Data = res } func (h *ShowSLocalHandler) checkParam() error { return nil }