Browse Source

update

master
DengBiao 9 months ago
parent
commit
a43f4e6bef
16 changed files with 18 additions and 6 deletions
  1. +1
    -1
      app/admin/md/good_list_resp.go
  2. +11
    -0
      app/admin/svc/goods/svc_goods_list.go
  3. +1
    -0
      app/db/model/goods.go
  4. +0
    -0
      app/ipad/lib/auth/auth.go
  5. +0
    -0
      app/ipad/lib/auth/base.go
  6. +0
    -0
      app/ipad/lib/validate/validate_comm.go
  7. +0
    -0
      app/ipad/md/md_app_redis_key.go
  8. +0
    -0
      app/ipad/md/md_login.go
  9. +0
    -0
      app/ipad/md/md_sys_cfg.go
  10. +0
    -0
      app/ipad/mw/mw_cors.go
  11. +1
    -1
      app/ipad/mw/mw_customer_auth.go
  12. +0
    -0
      app/ipad/mw/mw_limiter.go
  13. +0
    -0
      app/ipad/mw/mw_recovery.go
  14. +1
    -1
      app/ipad/svc/svc_auth.go
  15. +2
    -2
      app/ipad/svc/svc_login.go
  16. +1
    -1
      app/router/ipad_router.go

+ 1
- 1
app/admin/md/good_list_resp.go View File

@@ -12,6 +12,6 @@ type MallGoodListResp struct {
Image string `json:"image"`
SaleStateText string `json:"state_text"`
SaleState int `json:"sale_state"`
StateCode int `json:"state_code"`
CategoryId string `json:"category_id"`
Sales int `json:"sales"`
}

+ 11
- 0
app/admin/svc/goods/svc_goods_list.go View File

@@ -29,6 +29,7 @@ func GetMallGoodsList(c *gin.Context, req *md.MallGoodsListReq) (interface{}, in
var goods md.MallGoodListResp
goods.GoodsId = item["goods_id"]
goods.SaleState = utils.StrToInt(item["sale_state"])
goods.Sales = utils.StrToInt(item["sales"])
goods.CreateAt = item["create_at"]

// 商品主图
@@ -46,6 +47,16 @@ func GetMallGoodsList(c *gin.Context, req *md.MallGoodsListReq) (interface{}, in
goods.UpdateAt = item["update_at"]
goods.Title = item["title"]

// 状态
switch utils.StrToInt64(item["sale_state"]) {
case 1.00:
goods.SaleStateText = "銷售中"
break
case 2.00:
goods.SaleStateText = "下架"
break
}

// sku
for _, skuItem := range skus {
if skuItem.GoodsId == utils.StrToInt64(item["goods_id"]) {


+ 1
- 0
app/db/model/goods.go View File

@@ -10,6 +10,7 @@ type Goods struct {
Detail string `json:"detail" xorm:"comment('商品详情') TEXT"`
Price string `json:"price" xorm:"comment('起底价') DECIMAL(10,2)"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') INT(11)"`
Sales int `json:"sales" xorm:"not null default 0 comment('销量') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"`
DeleteAt string `json:"delete_at" xorm:"comment('商品删除字段,不为null时,表示删除') DATETIME"`


app/customer/lib/auth/auth.go → app/ipad/lib/auth/auth.go View File


app/customer/lib/auth/base.go → app/ipad/lib/auth/base.go View File


app/customer/lib/validate/validate_comm.go → app/ipad/lib/validate/validate_comm.go View File


app/customer/md/md_app_redis_key.go → app/ipad/md/md_app_redis_key.go View File


app/customer/md/md_login.go → app/ipad/md/md_login.go View File


app/customer/md/md_sys_cfg.go → app/ipad/md/md_sys_cfg.go View File


app/customer/mw/mw_cors.go → app/ipad/mw/mw_cors.go View File


app/customer/mw/mw_customer_auth.go → app/ipad/mw/mw_customer_auth.go View File

@@ -1,8 +1,8 @@
package mw

import (
"applet/app/customer/svc"
"applet/app/e"
"applet/app/ipad/svc"
"github.com/gin-gonic/gin"
)


app/customer/mw/mw_limiter.go → app/ipad/mw/mw_limiter.go View File


app/customer/mw/mw_recovery.go → app/ipad/mw/mw_recovery.go View File


app/customer/svc/svc_auth.go → app/ipad/svc/svc_auth.go View File

@@ -1,9 +1,9 @@
package svc

import (
"applet/app/customer/lib/auth"
"applet/app/db"
"applet/app/db/model"
"applet/app/ipad/lib/auth"
"errors"
"github.com/gin-gonic/gin"
"strings"

app/customer/svc/svc_login.go → app/ipad/svc/svc_login.go View File

@@ -1,9 +1,9 @@
package svc

import (
"applet/app/customer/lib/auth"
"applet/app/customer/md"
"applet/app/db/model"
"applet/app/ipad/lib/auth"
"applet/app/ipad/md"
"applet/app/utils/cache"
"applet/app/utils/logx"
)

+ 1
- 1
app/router/ipad_router.go View File

@@ -1,7 +1,7 @@
package router

import (
"applet/app/customer/mw"
"applet/app/ipad/mw"
"github.com/gin-gonic/gin"
)



Loading…
Cancel
Save