12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- )
- func WrapFindKuaishouProductHandler(ctx *gin.Context) {
- handler := newFindKuaishouProductHandler(ctx)
- baseRun(handler)
- }
- func newFindKuaishouProductHandler(ctx *gin.Context) *FindKuaishouProductHandler {
- return &FindKuaishouProductHandler{
- req: http_model.NewFindKuaishouProductRequest(),
- resp: http_model.NewFindKuaishouProductResponse(),
- ctx: ctx,
- }
- }
- type FindKuaishouProductHandler struct {
- req *http_model.FindKuaishouProductRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *FindKuaishouProductHandler) getRequest() interface{} {
- return h.req
- }
- func (h *FindKuaishouProductHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *FindKuaishouProductHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *FindKuaishouProductHandler) run() {
- data := *&http_model.FindKuaishouProductRequest{}
- data = *h.req
- // print("data: ", data.ItemList)
- res, err := service.Product.QueryKuaishouProduct(h.ctx, data)
- if err != nil {
- logrus.Info("FindKuaishouProduct fail,req:%+v", h.req)
- return
- }
- h.resp.Data = res
- }
- func (h *FindKuaishouProductHandler) checkParam() error {
- return nil
- }
|