package handler import ( "github.com/gin-gonic/gin" "youngee_b_api/model/http_model" "youngee_b_api/service" ) func WrapTalentListHandler(ctx *gin.Context) { handler := newTalentListHandler(ctx) baseRun(handler) } func newTalentListHandler(ctx *gin.Context) *TalentListHandler { return &TalentListHandler{ req: http_model.NewTalentListRequest(), resp: http_model.NewTalentListResponse(), ctx: ctx, } } type TalentListHandler struct { req *http_model.TalentListRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *TalentListHandler) getRequest() interface{} { return h.req } func (h *TalentListHandler) getContext() *gin.Context { return h.ctx } func (h *TalentListHandler) getResponse() interface{} { return h.resp } func (h *TalentListHandler) run() { talentListData, err := service.STCooperate.GetTalentListInfo(h.ctx, h.req) if err != nil { h.resp.Message = err.Error() h.resp.Data = err h.resp.Status = 40000 return } h.resp.Message = "ok" h.resp.Status = 20000 h.resp.Data = talentListData } func (h *TalentListHandler) checkParam() error { return nil }