Xingyu Xian преди 4 месеца
родител
ревизия
de8663877e
променени са 3 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 6 0
      handler/find_kuaishou_product.go
  2. 2 3
      route/init.go
  3. 1 0
      service/product.go

+ 6 - 0
handler/find_kuaishou_product.go

@@ -35,6 +35,7 @@ func (h *FindKuaishouProductHandler) getContext() *gin.Context {
 func (h *FindKuaishouProductHandler) getResponse() interface{} {
 func (h *FindKuaishouProductHandler) getResponse() interface{} {
 	return h.resp
 	return h.resp
 }
 }
+
 func (h *FindKuaishouProductHandler) run() {
 func (h *FindKuaishouProductHandler) run() {
 	data := *&http_model.FindKuaishouProductRequest{}
 	data := *&http_model.FindKuaishouProductRequest{}
 	data = *h.req
 	data = *h.req
@@ -43,10 +44,15 @@ func (h *FindKuaishouProductHandler) run() {
 	res, err := service.Product.QueryKuaishouProduct(h.ctx, data)
 	res, err := service.Product.QueryKuaishouProduct(h.ctx, data)
 	if err != nil {
 	if err != nil {
 		logrus.Info("FindKuaishouProduct fail,req:%+v", h.req)
 		logrus.Info("FindKuaishouProduct fail,req:%+v", h.req)
+		h.resp.Status = 40000
+		h.resp.Message = err.Error()
 		return
 		return
 	}
 	}
+	h.resp.Status = 20000
+	h.resp.Message = "成功查询"
 	h.resp.Data = res
 	h.resp.Data = res
 }
 }
+
 func (h *FindKuaishouProductHandler) checkParam() error {
 func (h *FindKuaishouProductHandler) checkParam() error {
 	return nil
 	return nil
 }
 }

+ 2 - 3
route/init.go

@@ -50,8 +50,9 @@ func InitRoute(r *gin.Engine) {
 			auth := middleware.GetSessionAuth(c)
 			auth := middleware.GetSessionAuth(c)
 			logrus.Infof("auth:%+v", auth)
 			logrus.Infof("auth:%+v", auth)
 		})
 		})
-		m.POST("/product/findall", handler.WrapFindAllProductHandler)                   //查询全部产品
+		m.POST("/product/findall", handler.WrapFindAllProductHandler)                   // 查询全部产品
 		m.POST("/product/find", handler.WrapFindProductHandler)                         // 查找单个产品
 		m.POST("/product/find", handler.WrapFindProductHandler)                         // 查找单个产品
+		m.POST("/product/findKuaishou", handler.WrapFindKuaishouProductHandler)         // 查询快手产品信息
 		m.POST("/project/create", handler.WrapCreateProjectHandler)                     // 创建项目
 		m.POST("/project/create", handler.WrapCreateProjectHandler)                     // 创建项目
 		m.POST("/project/show", handler.WrapShowProjectHandler)                         // 展示项目内容
 		m.POST("/project/show", handler.WrapShowProjectHandler)                         // 展示项目内容
 		m.POST("/project/update", handler.WrapUpdateProjectHandler)                     // 更新项目
 		m.POST("/project/update", handler.WrapUpdateProjectHandler)                     // 更新项目
@@ -311,7 +312,6 @@ func InitRoute(r *gin.Engine) {
 		finance.POST("/bill/selection/list", controller.BillController{}.SelectionBillList) // 账单查询-电商带货列表
 		finance.POST("/bill/selection/list", controller.BillController{}.SelectionBillList) // 账单查询-电商带货列表
 		finance.POST("/bill/project/list", controller.BillController{}.ProjectBillList)     // 账单查询-品牌种草列表
 		finance.POST("/bill/project/list", controller.BillController{}.ProjectBillList)     // 账单查询-品牌种草列表
 		finance.POST("/bill/local/list", controller.BillController{}.LocalLifeBillList)     // 账单查询-本地生活列表
 		finance.POST("/bill/local/list", controller.BillController{}.LocalLifeBillList)     // 账单查询-本地生活列表
-
 	}
 	}
 	// 推广合作-服务商相关接口
 	// 推广合作-服务商相关接口
 	cooperation := r.Group("/youngee/b/cooperation/supplier")
 	cooperation := r.Group("/youngee/b/cooperation/supplier")
@@ -348,5 +348,4 @@ func InitRoute(r *gin.Engine) {
 		account.Use(middleware.LoginAuthMiddleware)
 		account.Use(middleware.LoginAuthMiddleware)
 		account.POST("/businessLicense", controller.AccountController{}.OCRIdentify) // 营业执照OCR识别/认证
 		account.POST("/businessLicense", controller.AccountController{}.OCRIdentify) // 营业执照OCR识别/认证
 	}
 	}
-
 }
 }

+ 1 - 0
service/product.go

@@ -177,6 +177,7 @@ func (*product) QueryKuaishouProduct(ctx context.Context, newKuaishouProduct htt
 	signSecret := "bf6393dce0a2b669ee348bebb837b0da"
 	signSecret := "bf6393dce0a2b669ee348bebb837b0da"
 	kuaishouProduct, err := kuaishou.Queryselectiondetail(appKey, signSecret, AccessToken, newKuaishouProduct.ItemList)
 	kuaishouProduct, err := kuaishou.Queryselectiondetail(appKey, signSecret, AccessToken, newKuaishouProduct.ItemList)
 	if err != nil {
 	if err != nil {
+		fmt.Println("快手错误信息: ", err)
 		return nil, err
 		return nil, err
 	}
 	}
 	fmt.Println("kuaishouProduct: ", kuaishouProduct)
 	fmt.Println("kuaishouProduct: ", kuaishouProduct)