From fb1bb7a3a9beced35c561975e77ccf0f4902c01c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 12 Sep 2024 14:46:19 +0800 Subject: [PATCH] 1 --- app/router/router.go | 6 +++--- app/svc/svc_goods.go | 17 ++++++++--------- app/svc/svc_store.go | 1 + 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/router/router.go b/app/router/router.go index 94edf78..e5cf5cc 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -45,16 +45,16 @@ func routeCommunityTeam(r *gin.RouterGroup) { r.Use(mw.CheckBody) //body参数转换 r.Use(mw.CheckSign) //签名校验 r.Use(mw.Checker) - r.GET("/cate", hdl.Cate) r.GET("/bank/store/cate", hdl.BankStoreCate) r.POST("/bank/store/list", hdl.BankStore) r.POST("/store", hdl.Store) + r.GET("/goods/cate", hdl.Cate) + r.POST("/goods", hdl.Goods) + r.POST("/goods/sku", hdl.GoodsSku) // 用户授权后调用的接口 r.Use(mw.AuthJWT) r.POST("/store/addLike", hdl.StoreAddLike) r.POST("/store/cancelLike", hdl.StoreCancelLike) - r.POST("/goods", hdl.Goods) - r.POST("/goods/sku", hdl.GoodsSku) r.POST("/goods/coupon", hdl.GoodsCoupon) r.POST("/order/total", hdl.OrderTotal) r.POST("/order/create", hdl.OrderCreate) diff --git a/app/svc/svc_goods.go b/app/svc/svc_goods.go index 7c6f19e..326088a 100644 --- a/app/svc/svc_goods.go +++ b/app/svc/svc_goods.go @@ -23,15 +23,14 @@ func Goods(c *gin.Context) { json.Unmarshal([]byte(v.SpeImages), &speImageList) } tmp := map[string]interface{}{ - "id": utils.IntToStr(v.Id), - "title": v.Title, - "img": v.Img, - "info": v.Info, - "price": v.Price, - "stock": utils.IntToStr(v.Stock), - "is_single_sku": utils.IntToStr(v.IsSingleSku), - "sale_count": utils.IntToStr(v.SaleCount), - "spe_image_list": speImageList, + "id": utils.IntToStr(v.Id), + "title": v.Title, + "img": v.Img, + "info": v.Info, + "price": v.Price, + "stock": utils.IntToStr(v.Stock), + "is_single_sku": utils.IntToStr(v.IsSingleSku), + "sale_count": utils.IntToStr(v.SaleCount), } goodsList = append(goodsList, tmp) } diff --git a/app/svc/svc_store.go b/app/svc/svc_store.go index 928a365..a836f68 100644 --- a/app/svc/svc_store.go +++ b/app/svc/svc_store.go @@ -83,6 +83,7 @@ func Store(c *gin.Context) { "work_state": v["work_state"], "name": v["name"], "id": v["id"], + "uid": v["uid"], "km": v["km"], "time_str": v["timer"], "phone": v["phone"],