Browse Source

productSnapBugFixed

Xingyu Xian 4 months ago
parent
commit
d6573e6b63

+ 1 - 1
consts/error_code.go

@@ -10,7 +10,7 @@ const DefaultToast = ""
 const ErrorSuccess int32 = 20000
 const ErrorNotLogin int32 = 44000
 const ErrorParamCheck int32 = 40000
-const ErrorInternal int32 = 50001
+const ErrorInternal int32 = 40000
 
 func init() {
 	errorCodeToastMap[ErrorSuccess] = "请求成功"

+ 1 - 1
handler/GetSecTaskList.go

@@ -44,7 +44,7 @@ func (c GetSecTaskList) run() {
 		logrus.Info("GetSecTaskList fail,req:%+v", c.req)
 		return
 	}
-	c.resp.Message = "ok"
+	c.resp.Message = "成功查询带货子任务"
 	c.resp.Data = res
 	c.resp.Status = 20000
 	return

+ 2 - 0
handler/PassSecTaskCoop.go

@@ -42,6 +42,8 @@ func (c PassSecTaskCoop) run() {
 		logrus.Errorf("[PassSecTaskCoop] call PassSecTaskCoop err:%+v\n", err)
 		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
 		logrus.Info("PassSecTaskCoop fail,req:%+v", c.req)
+		c.resp.Message = err.Error()
+		c.resp.Status = 40000
 		return
 	}
 	c.resp.Message = "ok"

+ 4 - 3
handler/find_kuaishou_product.go

@@ -3,8 +3,10 @@ package handler
 import (
 	"github.com/gin-gonic/gin"
 	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
 	"youngee_b_api/model/http_model"
 	"youngee_b_api/service"
+	"youngee_b_api/util"
 )
 
 func WrapFindKuaishouProductHandler(ctx *gin.Context) {
@@ -43,9 +45,8 @@ func (h *FindKuaishouProductHandler) run() {
 
 	res, err := service.Product.QueryKuaishouProduct(h.ctx, data)
 	if err != nil {
-		logrus.Info("FindKuaishouProduct fail,req:%+v", h.req)
-		h.resp.Status = 40000
-		h.resp.Message = err.Error()
+		logrus.WithContext(h.ctx).Errorf("[FindKuaishouProductHandler] error FindKuaishouProductHandler, err:%+v", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast)
 		return
 	}
 	h.resp.Status = 20000

+ 1 - 1
handler/selection_find_all.go

@@ -48,7 +48,7 @@ func (f FindAllSelectionHandler) run() {
 	}
 	f.resp.Data = data
 	f.resp.Status = 20000
-	f.resp.Message = "ok"
+	f.resp.Message = "成功查询带货任务"
 	return
 }