1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package handler
- import (
- "fmt"
- "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 = "查询失败"
- h.resp.Data = err
- fmt.Println(err)
- }
- h.resp.Message = "成功查询达人合作信息"
- h.resp.Data = talentListData
- }
- func (h *TalentListHandler) checkParam() error {
- return nil
- }
|