fix:积分商城
This commit is contained in:
parent
0322ba843a
commit
22a2eccebe
|
@ -341,7 +341,26 @@ func UserData(c *gin.Context) {
|
||||||
RespJson(c, status.Unauthorized, nil)
|
RespJson(c, status.Unauthorized, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var userVm model.UserVm
|
||||||
|
err := model.NewUserVmQuerySet(model.DB).UidEq(uc.Uid).One(&userVm)
|
||||||
|
if err != nil && err != model.RecordNotFound {
|
||||||
|
logger.Error("err")
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err == model.RecordNotFound {
|
||||||
|
userVm = model.UserVm{
|
||||||
|
Uid: uc.Uid,
|
||||||
|
Vm: 0,
|
||||||
|
}
|
||||||
|
err = model.DB.Create(&userVm).Error
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.UserVm = &userVm
|
||||||
ret := m
|
ret := m
|
||||||
RespOK(c, ret)
|
RespOK(c, ret)
|
||||||
return
|
return
|
||||||
|
|
|
@ -368,6 +368,23 @@ func PushWXPayNotice(c *gin.Context) {
|
||||||
if num == 0 {
|
if num == 0 {
|
||||||
logger.Error("update deposit num is 0")
|
logger.Error("update deposit num is 0")
|
||||||
}
|
}
|
||||||
|
} else if notify.Attach == wxpay.WxPayExchangeGoods {
|
||||||
|
_, err := model.NewGoodsOrderQuerySet(model.DB).SerialNoEq(notify.OutTradeNo).GetUpdater().
|
||||||
|
SetPayTime(time.Now()).
|
||||||
|
SetPayStatus(model.PayStatusOK).UpdateNum()
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
}
|
||||||
|
var goodsOrder model.GoodsOrder
|
||||||
|
err = model.NewGoodsOrderQuerySet(model.DB).SerialNoEq(notify.OutTradeNo).One(&goodsOrder)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
}
|
||||||
|
err = model.OrderUpdateGoodsStock(goodsOrder.GoodsId, goodsOrder.Quantity, model.DB)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Debug("微信推动支付通知")
|
logger.Debug("微信推动支付通知")
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"github.com/codinl/go-logger"
|
"github.com/codinl/go-logger"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"mh-server/lib/auth"
|
"mh-server/lib/auth"
|
||||||
"mh-server/lib/status"
|
"mh-server/lib/status"
|
||||||
|
"mh-server/lib/wxpay"
|
||||||
"mh-server/model"
|
"mh-server/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -91,7 +93,7 @@ func MallOrderCreate(c *gin.Context) {
|
||||||
// 库存不足
|
// 库存不足
|
||||||
if goods.Stock < req.Quantity {
|
if goods.Stock < req.Quantity {
|
||||||
logger.Error("err:", err)
|
logger.Error("err:", err)
|
||||||
RespJson(c, status.OrderUnpaidDeposit, nil)
|
RespJson(c, status.OrderStockOut, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +129,7 @@ func MallOrderCreate(c *gin.Context) {
|
||||||
AddressId: req.AddressId,
|
AddressId: req.AddressId,
|
||||||
DeliveryExtraInfo: req.DeliveryExtraInfo,
|
DeliveryExtraInfo: req.DeliveryExtraInfo,
|
||||||
DeliveryFee: goods.DeliveryFee,
|
DeliveryFee: goods.DeliveryFee,
|
||||||
|
DeliveryStatus: model.DeliveryStatusUnDeliver,
|
||||||
}
|
}
|
||||||
err = order.Create(tx)
|
err = order.Create(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -138,10 +141,68 @@ func MallOrderCreate(c *gin.Context) {
|
||||||
|
|
||||||
// TODO 减少库存
|
// TODO 减少库存
|
||||||
// TODO 确认下是在支付后减少,还是下单后?
|
// TODO 确认下是在支付后减少,还是下单后?
|
||||||
|
if req.PayType == model.PayTypeVm {
|
||||||
|
var userVm model.UserVm
|
||||||
|
err = model.NewUserVmQuerySet(model.DB).UidEq(uc.Uid).One(&userVm)
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if userVm.Vm < amount {
|
||||||
|
tx.Rollback()
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.UserVmNotEnough, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := model.OrderDeductionUserVm(uc.Uid, int(userVm.Vm), int(amount)*-1, tx)
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tx.Commit()
|
err = tx.Commit().Error
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
RespOK(c, order)
|
var user model.User
|
||||||
|
err = model.NewUserQuerySet(model.DB).UidEq(uint32(order.Uid)).One(&user)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("Order err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
webPay, err := wxpay.WebPay(order.SerialNo, goods.DeliveryFee, user.WxOpenID, "N", wxpay.WxPayExchangeGoods)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(errors.New("WebPay err"))
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = model.UserOpenMemberRecord{Uid: uc.Uid, OpenNo: order.SerialNo, OrderId: order.ID, OrderType: 3}.Insert()
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(errors.New("WebPay err"))
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ret := map[string]interface{}{
|
||||||
|
"web_pay": webPay,
|
||||||
|
"order_id": order.ID,
|
||||||
|
"order": order,
|
||||||
|
}
|
||||||
|
|
||||||
|
RespOK(c, ret)
|
||||||
|
//RespOK(c, order)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,3 +326,59 @@ func MallOrderDetail(c *gin.Context) {
|
||||||
RespOK(c, detail)
|
RespOK(c, detail)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MallUserVmRecord(c *gin.Context) {
|
||||||
|
req := model.MallUserVmRecordReq{}
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
logger.Error(err)
|
||||||
|
RespJson(c, status.BadRequest, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
uc := auth.GetCurrentUser(c)
|
||||||
|
if uc == nil {
|
||||||
|
RespJson(c, status.Unauthorized, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, total, err := req.UserVmRecordList(uc.Uid)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ret := map[string]interface{}{
|
||||||
|
"list": list,
|
||||||
|
"cur_page": req.PageIdx,
|
||||||
|
"total_page": total,
|
||||||
|
}
|
||||||
|
|
||||||
|
RespOK(c, ret)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func MallGoodsOrderConfirmReceipt(c *gin.Context) {
|
||||||
|
req := model.MallGoodsOrderConfirmReceiptReq{}
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
logger.Error(err)
|
||||||
|
RespJson(c, status.BadRequest, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
uc := auth.GetCurrentUser(c)
|
||||||
|
if uc == nil {
|
||||||
|
RespJson(c, status.Unauthorized, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := req.MallGoodsOrderConfirmReceipt(uc.Uid)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
RespJson(c, status.InternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
RespOK(c, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ const (
|
||||||
CaptchaDelivered = 403044 // 验证码已发出
|
CaptchaDelivered = 403044 // 验证码已发出
|
||||||
NeedBindTel = 403045 // 需要绑定手机号
|
NeedBindTel = 403045 // 需要绑定手机号
|
||||||
ShoppingTimesNotEnough = 403046 // 购物次数不足
|
ShoppingTimesNotEnough = 403046 // 购物次数不足
|
||||||
|
UserVmNotEnough = 403049 // 用户积分余额不足
|
||||||
|
|
||||||
HbKeySendFail = 403055 // 口令发送失败,60秒后重试
|
HbKeySendFail = 403055 // 口令发送失败,60秒后重试
|
||||||
IsNoviceFail = 403056 // 不是新用户
|
IsNoviceFail = 403056 // 不是新用户
|
||||||
|
|
|
@ -34,9 +34,10 @@ const (
|
||||||
//wxPayNotifyUrl = "api/v1/wxpay/notice"
|
//wxPayNotifyUrl = "api/v1/wxpay/notice"
|
||||||
wxPayNotifyUrl = "/api/v1/wxpay/notice"
|
wxPayNotifyUrl = "/api/v1/wxpay/notice"
|
||||||
|
|
||||||
WxPayMember = "member_pay" // 会员
|
WxPayMember = "member_pay" // 会员
|
||||||
WxPayRentCard = "rent_card_pay" // 租卡
|
WxPayRentCard = "rent_card_pay" // 租卡
|
||||||
WxPayDeposit = "deposit_pay" // 押金
|
WxPayDeposit = "deposit_pay" // 押金
|
||||||
|
WxPayExchangeGoods = "exchange_goods" // 押金
|
||||||
|
|
||||||
//NotifyUrl = "https://switch.deovo.com:8001/api/v1/wxpay/notice" // TODO 数据库配置 生产
|
//NotifyUrl = "https://switch.deovo.com:8001/api/v1/wxpay/notice" // TODO 数据库配置 生产
|
||||||
//NotifyUrl = "https://dev.switch.deovo.com:8004/api/v1/wxpay/notice" // TODO 测试
|
//NotifyUrl = "https://dev.switch.deovo.com:8004/api/v1/wxpay/notice" // TODO 测试
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
1539
model/autogenerated_user_vm.go
Normal file
1539
model/autogenerated_user_vm.go
Normal file
File diff suppressed because it is too large
Load Diff
BIN
model/goqueryset
Executable file
BIN
model/goqueryset
Executable file
Binary file not shown.
193
model/mall.go
193
model/mall.go
|
@ -1,7 +1,9 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/codinl/go-logger"
|
"github.com/codinl/go-logger"
|
||||||
|
"github.com/jinzhu/gorm"
|
||||||
"mh-server/lib/utils"
|
"mh-server/lib/utils"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -24,6 +26,12 @@ const (
|
||||||
PayStatusOK
|
PayStatusOK
|
||||||
PayStatusFail
|
PayStatusFail
|
||||||
)
|
)
|
||||||
|
const (
|
||||||
|
DeliveryStatusUnknown = iota
|
||||||
|
DeliveryStatusUnDeliver // 1-待发货
|
||||||
|
DeliveryStatusDelivered // 2-已发货
|
||||||
|
DeliveryStatusHarvestGoods // 3-已收货
|
||||||
|
)
|
||||||
|
|
||||||
// 商品
|
// 商品
|
||||||
//go:generate goqueryset -in mall.go
|
//go:generate goqueryset -in mall.go
|
||||||
|
@ -48,8 +56,8 @@ type Goods struct {
|
||||||
PriceRm uint32 `json:"price_rm"` // 人民币价格
|
PriceRm uint32 `json:"price_rm"` // 人民币价格
|
||||||
PriceOriginal uint32 `json:"price_original"` // 市场价
|
PriceOriginal uint32 `json:"price_original"` // 市场价
|
||||||
DeliveryFee uint32 `json:"delivery_fee"` // 邮费
|
DeliveryFee uint32 `json:"delivery_fee"` // 邮费
|
||||||
|
DealType uint32 `json:"deal_type"` // 1-积分兑换 2-购买 3-抵扣
|
||||||
VersionId uint64 `json:"version_id"` // 乐观锁
|
VersionId uint64 `json:"version_id"` // 乐观锁
|
||||||
}
|
}
|
||||||
|
|
||||||
//// gen:qs
|
//// gen:qs
|
||||||
|
@ -92,7 +100,7 @@ func (m *GoodsListReq) GoodsList() ([]Goods, int, error) {
|
||||||
m.PageSize = 10
|
m.PageSize = 10
|
||||||
}
|
}
|
||||||
var goodsList []Goods
|
var goodsList []Goods
|
||||||
qs := NewGoodsQuerySet(DB)
|
qs := NewGoodsQuerySet(DB).SaleStatusEq(1)
|
||||||
|
|
||||||
count, err := qs.Count()
|
count, err := qs.Count()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -158,9 +166,13 @@ type GoodsOrder struct {
|
||||||
DeliveryExtraInfo string `json:"delivery_extra_info"` // 物流备注
|
DeliveryExtraInfo string `json:"delivery_extra_info"` // 物流备注
|
||||||
DeliveryFee uint32 `json:"delivery_fee"` // 物流费用
|
DeliveryFee uint32 `json:"delivery_fee"` // 物流费用
|
||||||
DeliveryTrackingNo string `json:"delivery_tracking_no"` // 物流单号
|
DeliveryTrackingNo string `json:"delivery_tracking_no"` // 物流单号
|
||||||
|
DeliveryCompany string `json:"delivery_company"` // 物流公司
|
||||||
DeliveryStatus uint32 `json:"delivery_status"` // 物流状态 1-待发货 2-已发货 3-已收货
|
DeliveryStatus uint32 `json:"delivery_status"` // 物流状态 1-待发货 2-已发货 3-已收货
|
||||||
|
|
||||||
VersionId uint64 `json:"version_id"` // 乐观锁
|
VersionId uint64 `json:"version_id"` // 乐观锁
|
||||||
|
|
||||||
|
Goods *Goods `json:"goods" gorm:"-"`
|
||||||
|
UserAddress *UserAddress `json:"user_address" gorm:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateGoodsOrderSerialNo() string {
|
func CreateGoodsOrderSerialNo() string {
|
||||||
|
@ -184,8 +196,9 @@ func CreateGoodsOrderId() uint32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
type GoodsOrderListReq struct {
|
type GoodsOrderListReq struct {
|
||||||
PageIdx int `json:"page_idx"`
|
PageIdx int `json:"page_idx"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
|
DeliveryStatus uint32 `json:"delivery_status"` // 物流状态 1-待发货 2-已发货 3-已收货
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GoodsOrderListReq) OrderList(uid uint32) ([]GoodsOrder, int, error) {
|
func (m *GoodsOrderListReq) OrderList(uid uint32) ([]GoodsOrder, int, error) {
|
||||||
|
@ -198,7 +211,151 @@ func (m *GoodsOrderListReq) OrderList(uid uint32) ([]GoodsOrder, int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var list []GoodsOrder
|
var list []GoodsOrder
|
||||||
qs := NewGoodsOrderQuerySet(DB)
|
qs := NewGoodsOrderQuerySet(DB).PayStatusEq(PayStatusOK)
|
||||||
|
|
||||||
|
if uid != 0 {
|
||||||
|
qs = qs.UidEq(uid)
|
||||||
|
}
|
||||||
|
if m.DeliveryStatus != 0 {
|
||||||
|
qs = qs.DeliveryStatusEq(m.DeliveryStatus)
|
||||||
|
}
|
||||||
|
count, err := qs.Count()
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
totalPage := count/m.PageSize + 1
|
||||||
|
|
||||||
|
err = qs.OrderDescByID().Offset(page * m.PageSize).Limit(m.PageSize).All(&list)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
list = GoodsOrderListSetGoods(list)
|
||||||
|
|
||||||
|
return list, totalPage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type GoodsOrderDetailReq struct {
|
||||||
|
OrderId uint32 `json:"order_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GoodsOrderDetailReq) OrderDetail(uid uint32) (*GoodsOrder, error) {
|
||||||
|
var order GoodsOrder
|
||||||
|
qs := NewGoodsOrderQuerySet(DB).OrderIdEq(m.OrderId)
|
||||||
|
|
||||||
|
if uid != 0 {
|
||||||
|
qs = qs.UidEq(uid)
|
||||||
|
}
|
||||||
|
|
||||||
|
err := qs.One(&order)
|
||||||
|
if err != nil && err != RecordNotFound {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
orders := GoodsOrderListSetGoods([]GoodsOrder{order})
|
||||||
|
if len(orders) > 0 {
|
||||||
|
order.Goods = orders[0].Goods
|
||||||
|
}
|
||||||
|
var userAddress UserAddress
|
||||||
|
err = NewUserAddressQuerySet(DB).IDEq(order.AddressId).One(&userAddress)
|
||||||
|
if err != nil && err != RecordNotFound {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
order.UserAddress = &userAddress
|
||||||
|
return &order, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func OrderDeductionUserVm(uid uint32, userVmAmount, vm int, gdb *gorm.DB) error {
|
||||||
|
|
||||||
|
sql := fmt.Sprintf("UPDATE user_vm SET vm = vm+? WHERE uid=? ")
|
||||||
|
err := gdb.Exec(sql, vm, uid).Error
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
vmRecord := &UserVmRecord{
|
||||||
|
Uid: uid,
|
||||||
|
BeforeVm: uint32(userVmAmount),
|
||||||
|
AfterVm: uint32(int(userVmAmount) + vm),
|
||||||
|
Alter: vm,
|
||||||
|
Event: "exchange_goods",
|
||||||
|
Describe: "兑换礼品",
|
||||||
|
}
|
||||||
|
err = gdb.Create(vmRecord).Error
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func OrderUpdateGoodsStock(goodsId, count uint32, gdb *gorm.DB) error {
|
||||||
|
sql := fmt.Sprintf("UPDATE goods SET stock=stock-%d,sold_count=sold_count+%d WHERE goods_id = %d", count, count, goodsId)
|
||||||
|
err := gdb.Exec(sql).Error
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetGoodsMapByIds(ids []uint32) map[uint32]Goods {
|
||||||
|
goodsMap := make(map[uint32]Goods, 0)
|
||||||
|
if len(ids) == 0 {
|
||||||
|
return goodsMap
|
||||||
|
}
|
||||||
|
var goodsList []Goods
|
||||||
|
err := NewGoodsQuerySet(DB).GoodsIdIn(ids...).All(&goodsList)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("err:", err)
|
||||||
|
return goodsMap
|
||||||
|
}
|
||||||
|
for i, _ := range goodsList {
|
||||||
|
goodsMap[goodsList[i].GoodsId] = goodsList[i]
|
||||||
|
}
|
||||||
|
|
||||||
|
return goodsMap
|
||||||
|
}
|
||||||
|
|
||||||
|
func GoodsOrderListSetGoods(orders []GoodsOrder) []GoodsOrder {
|
||||||
|
if len(orders) == 0 {
|
||||||
|
return orders
|
||||||
|
}
|
||||||
|
ids := make([]uint32, 0, len(orders))
|
||||||
|
for i, _ := range orders {
|
||||||
|
ids = append(ids, orders[i].GoodsId)
|
||||||
|
}
|
||||||
|
goodsMap := GetGoodsMapByIds(ids)
|
||||||
|
for i, _ := range orders {
|
||||||
|
v, ok := goodsMap[orders[i].GoodsId]
|
||||||
|
if ok {
|
||||||
|
orders[i].Goods = &v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orders
|
||||||
|
}
|
||||||
|
|
||||||
|
type MallUserVmRecordReq struct {
|
||||||
|
PageIdx int `json:"page_idx"`
|
||||||
|
PageSize int `json:"page_size"`
|
||||||
|
//Uid uint32 `json:"uid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MallUserVmRecordReq) UserVmRecordList(uid uint32) ([]UserVmRecord, int, error) {
|
||||||
|
page := m.PageIdx - 1
|
||||||
|
if page < 0 {
|
||||||
|
page = 0
|
||||||
|
}
|
||||||
|
if m.PageSize == 0 {
|
||||||
|
m.PageSize = 10
|
||||||
|
}
|
||||||
|
|
||||||
|
var list []UserVmRecord
|
||||||
|
qs := NewUserVmRecordQuerySet(DB)
|
||||||
|
|
||||||
if uid != 0 {
|
if uid != 0 {
|
||||||
qs = qs.UidEq(uid)
|
qs = qs.UidEq(uid)
|
||||||
|
@ -211,8 +368,8 @@ func (m *GoodsOrderListReq) OrderList(uid uint32) ([]GoodsOrder, int, error) {
|
||||||
}
|
}
|
||||||
totalPage := count/m.PageSize + 1
|
totalPage := count/m.PageSize + 1
|
||||||
|
|
||||||
err = qs.Offset(page * m.PageSize).Limit(m.PageSize).All(&list)
|
err = qs.OrderDescByID().Offset(page * m.PageSize).Limit(m.PageSize).All(&list)
|
||||||
if err != nil {
|
if err != nil && err != RecordNotFound {
|
||||||
logger.Error("err:", err)
|
logger.Error("err:", err)
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
@ -220,24 +377,16 @@ func (m *GoodsOrderListReq) OrderList(uid uint32) ([]GoodsOrder, int, error) {
|
||||||
return list, totalPage, nil
|
return list, totalPage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type GoodsOrderDetailReq struct {
|
type MallGoodsOrderConfirmReceiptReq struct {
|
||||||
OrderId uint32 `json:"order_id"`
|
OrderId uint32 `json:"order_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GoodsOrderDetailReq) OrderDetail(uid uint32) (*GoodsOrder, error) {
|
func (m *MallGoodsOrderConfirmReceiptReq) MallGoodsOrderConfirmReceipt(uid uint32) error {
|
||||||
var order GoodsOrder
|
_, err := NewGoodsOrderQuerySet(DB).OrderIdEq(m.OrderId).UidEq(uid).GetUpdater().
|
||||||
qs := NewGoodsOrderQuerySet(DB).
|
SetDeliveryStatus(DeliveryStatusHarvestGoods).UpdateNum()
|
||||||
OrderIdEq(m.OrderId)
|
|
||||||
|
|
||||||
if uid != 0 {
|
|
||||||
qs = qs.UidEq(uid)
|
|
||||||
}
|
|
||||||
|
|
||||||
err := qs.One(&order)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("err:", err)
|
logger.Error("err:", err)
|
||||||
return nil, err
|
return err
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
return &order, nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,9 @@ func InitTestDB() {
|
||||||
&DepositRefundRecord{},
|
&DepositRefundRecord{},
|
||||||
&GroupSendMessageTemplate{},
|
&GroupSendMessageTemplate{},
|
||||||
&Goods{},
|
&Goods{},
|
||||||
|
&GoodsOrder{},
|
||||||
|
&UserVm{},
|
||||||
|
&UserVmRecord{},
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -558,8 +561,8 @@ func GoodsAdd() {
|
||||||
InitTestDB()
|
InitTestDB()
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
goods := Goods{
|
goods := Goods{
|
||||||
GoodsId: 1 + uint32(i)+1,
|
GoodsId: 1 + uint32(i) + 1,
|
||||||
SerialNo: "sdhfjskdhjk"+ fmt.Sprintf("%d", i+1),
|
SerialNo: "sdhfjskdhjk" + fmt.Sprintf("%d", i+1),
|
||||||
CatId: 1,
|
CatId: 1,
|
||||||
Name: "宝可梦剑" + fmt.Sprintf("%d", i+1),
|
Name: "宝可梦剑" + fmt.Sprintf("%d", i+1),
|
||||||
Title: "宝可梦剑",
|
Title: "宝可梦剑",
|
||||||
|
|
|
@ -35,6 +35,8 @@ type User struct {
|
||||||
InBlack bool `json:"in_black"` // 是否在黑名单
|
InBlack bool `json:"in_black"` // 是否在黑名单
|
||||||
StoreType uint8 `json:"store_type"` // 1-订单门店
|
StoreType uint8 `json:"store_type"` // 1-订单门店
|
||||||
Version uint32 `json:"-"`
|
Version uint32 `json:"-"`
|
||||||
|
|
||||||
|
UserVm *UserVm `json:"user_vm" gorm:"-"` //
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *User) TableName() string {
|
func (o *User) TableName() string {
|
||||||
|
@ -130,7 +132,7 @@ type UserOpenMemberRecord struct {
|
||||||
Uid uint32 `json:"uid"`
|
Uid uint32 `json:"uid"`
|
||||||
OpenNo string `json:"open_no" gorm:"index"`
|
OpenNo string `json:"open_no" gorm:"index"`
|
||||||
OrderId uint32 `json:"order_id"`
|
OrderId uint32 `json:"order_id"`
|
||||||
OrderType uint32 `json:"order_type"` // 1-物流支付
|
OrderType uint32 `json:"order_type"` // 1-物流支付 3-积分兑换商品物流
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +167,6 @@ type CommonProblem struct {
|
||||||
Sort uint32 `json:"sort" gorm:"index"`
|
Sort uint32 `json:"sort" gorm:"index"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type GroupSendMessageTemplate struct {
|
type GroupSendMessageTemplate struct {
|
||||||
Model
|
Model
|
||||||
|
|
||||||
|
@ -177,7 +178,6 @@ type GroupSendMessageTemplate struct {
|
||||||
Status uint32 `json:"status"` // 1-待发送 2-已发送
|
Status uint32 `json:"status"` // 1-待发送 2-已发送
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (*CommonProblem) TableName() string {
|
func (*CommonProblem) TableName() string {
|
||||||
return "common_problem"
|
return "common_problem"
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ func UserAddressList(uid uint32) (list []UserAddress, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (m *UserAddress) Info() error {
|
func (m *UserAddress) Info() error {
|
||||||
err := NewUserAddressQuerySet(DB).IDEq(m.ID).One(m)
|
err := NewUserAddressQuerySet(DB).IDEq(m.ID).One(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -50,4 +49,3 @@ func (m *UserAddress) Info() error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,11 @@ type UserVm struct {
|
||||||
type UserVmRecord struct {
|
type UserVmRecord struct {
|
||||||
Model
|
Model
|
||||||
|
|
||||||
Uid uint32 `json:"uid" gorm:"column:uid;unique_index"`
|
Uid uint32 `json:"uid" gorm:"column:uid;index"`
|
||||||
BeforeVm uint32 `json:"before_vm"` // 变动前
|
BeforeVm uint32 `json:"before_vm"` // 变动前
|
||||||
AfterVm uint32 `json:"after_vm"` // 变动后
|
AfterVm uint32 `json:"after_vm"` // 变动后
|
||||||
|
Alter int `json:"alter"` // 数值
|
||||||
Event string `json:"event" gorm:"type:varchar(100)"` // 事件
|
Event string `json:"event" gorm:"type:varchar(100)"` // 事件
|
||||||
Describe string `json:"describe" gorm:"type:text"` // 描述
|
Describe string `json:"describe" gorm:"type:text"` // 描述
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
287
pack/log_server/server.2022-03-05.log
Normal file
287
pack/log_server/server.2022-03-05.log
Normal file
|
@ -0,0 +1,287 @@
|
||||||
|
2022/03/05 18:37:00 [INFO ]base_init_db.go:38: DB init success
|
||||||
|
2022/03/05 18:40:45 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:40:45 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:40:46 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:40:46 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:40:46 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:43:20 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:21 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:23 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:24 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:24 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:44 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:43:44 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:43:45 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:43:45 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:45 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:43:45 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:43:45 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:43:49 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:44:02 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:44:02 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:44:02 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:44:02 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:44:02 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:44:12 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:44:12 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:44:12 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:44:12 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:44:12 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:23 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:46:23 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:46:23 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:23 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:46:24 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:31 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:46:31 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:46:31 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:31 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:46:31 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:34 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:46:34 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:46:34 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:46:35 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:46:35 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:47:02 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:47:02 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:47:02 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:47:03 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:47:03 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:47:38 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:47:38 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:47:39 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:47:39 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:47:39 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:48:02 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:48:02 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:48:02 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:48:02 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:48:02 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:48:05 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:48:05 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:48:05 [ERROR]mall.go:121: err: record not found
|
||||||
|
2022/03/05 18:48:05 [ERROR]mall.go:46: err: record not found
|
||||||
|
2022/03/05 18:50:10 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:50:27 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:50:27 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:50:27 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:50:27 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:50:28 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:50:28 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:50:31 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:52:52 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:52:52 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:52:52 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:52:52 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:52:52 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:52:53 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:52:53 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:53:04 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:05 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:53:11 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:12 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:13 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:14 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:16 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:17 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:18 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:53:33 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:53:33 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:53:33 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:53:33 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:53:33 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:53:35 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:36 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 18:53:37 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 18:53:49 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 18:59:16 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 18:59:16 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 18:59:16 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 18:59:17 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 18:59:17 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:05:28 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:05:28 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:05:37 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:06:38 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:06:38 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:06:38 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:06:38 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:06:38 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:06:53 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:06:53 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:06:54 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:06:54 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:06:54 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:05 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:07:05 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:07:05 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:05 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:07:05 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:09 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:07:10 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:07:10 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:07:17 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:07:17 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:07:17 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:17 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:07:18 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:07:18 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:18 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:07:19 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:07:48 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:07:49 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:07:50 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:08:17 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:08:17 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:08:17 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:08:18 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:08:18 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:08:28 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:08:29 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:08:30 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:16:05 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:16:05 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:16:05 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:16:05 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:16:05 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:16:39 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:16:39 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:16:40 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:16:40 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:16:40 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:17:31 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:17:33 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:18:47 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:18:47 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:18:47 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:18:47 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:18:47 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:19:03 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:19:03 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:19:04 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:19:04 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:19:04 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:19:10 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:19:10 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:19:10 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:19:11 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:11 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:12 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:19:12 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:19:18 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:19:19 [INFO ]init.go:30: /api/v1/user/address/detail
|
||||||
|
2022/03/05 19:19:25 [INFO ]init.go:30: /api/v1/user/address/update
|
||||||
|
2022/03/05 19:19:25 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:19:34 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:19:41 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:42 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:19:42 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:19:49 [INFO ]init.go:30: /api/v1/auth/login
|
||||||
|
2022/03/05 19:19:50 [INFO ]account.go:46: OpenID=ohuHh4tpfro8u_fUPMbHEWYx5svQ
|
||||||
|
2022/03/05 19:19:50 [INFO ]account.go:47: resp.UnionID=
|
||||||
|
2022/03/05 19:19:50 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:19:51 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:19:51 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:19:52 [INFO ]init.go:30: /api/v1/shopping_cart/list
|
||||||
|
2022/03/05 19:19:53 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:54 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:55 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:19:57 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:19:57 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:19:57 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:19:58 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:19:59 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:20:00 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:20:05 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:20:05 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:23:43 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:23:44 [INFO ]init.go:30: /api/v1/shopping_cart/list
|
||||||
|
2022/03/05 19:23:45 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:23:45 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:23:46 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:23:47 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:23:49 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:23:49 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:23:49 [INFO ]init.go:30: /api/v1/user/invite_applet_code
|
||||||
|
2022/03/05 19:23:51 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:23:51 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:24:00 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:24:00 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:24:58 [INFO ]base_init_db.go:38: DB init success
|
||||||
|
2022/03/05 19:25:23 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:25:23 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:25:27 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:25:28 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:25:30 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:25:30 [ERROR]mall.go:64: Key: 'Quantity' Error:Field validation for 'Quantity' failed on the 'required' tag
|
||||||
|
2022/03/05 19:25:43 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:25:43 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:25:43 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:25:44 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:25:44 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:25:44 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:25:45 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:25:46 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:25:50 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:25:57 [INFO ]init.go:30: /api/v1/auth/login
|
||||||
|
2022/03/05 19:25:58 [INFO ]account.go:46: OpenID=ohuHh4tpfro8u_fUPMbHEWYx5svQ
|
||||||
|
2022/03/05 19:25:58 [INFO ]account.go:47: resp.UnionID=
|
||||||
|
2022/03/05 19:25:58 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:26:00 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:26:01 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:26:02 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:26:30 [INFO ]base_init_db.go:38: DB init success
|
||||||
|
2022/03/05 19:26:33 [INFO ]init.go:30: /api/v1/auth/login
|
||||||
|
2022/03/05 19:26:33 [INFO ]account.go:46: OpenID=ohuHh4tpfro8u_fUPMbHEWYx5svQ
|
||||||
|
2022/03/05 19:26:33 [INFO ]account.go:47: resp.UnionID=
|
||||||
|
2022/03/05 19:26:33 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:26:34 [INFO ]init.go:30: /api/v1/mall/goods/detail
|
||||||
|
2022/03/05 19:26:35 [INFO ]init.go:30: /api/v1/user/address/list
|
||||||
|
2022/03/05 19:26:37 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:26:37 [ERROR]mall.go:133: err: Error 1146: Table 'mh_dev.goods_order' doesn't exist
|
||||||
|
2022/03/05 19:27:18 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:27:18 [ERROR]mall.go:133: err: Error 1146: Table 'mh_dev.goods_order' doesn't exist
|
||||||
|
2022/03/05 19:28:33 [INFO ]init.go:30: /api/v1/mall/order/create
|
||||||
|
2022/03/05 19:29:14 [INFO ]init.go:30: /api/v1/mall/goods/list
|
||||||
|
2022/03/05 19:29:15 [INFO ]init.go:30: /api/v1/user/data
|
||||||
|
2022/03/05 19:29:15 [INFO ]init.go:30: /api/v1/activity/redeem_code/user_redeem_code/list
|
||||||
|
2022/03/05 19:29:53 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:29:53 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:29:53 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:29:54 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:29:54 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:34:45 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:34:45 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:34:46 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:34:46 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:34:46 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:12 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:37:12 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:37:12 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:12 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:37:12 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:15 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:37:15 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:37:15 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:15 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:37:16 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:37:16 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:37:16 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:17 [INFO ]init.go:30: /api/v1/game_card/type/list
|
||||||
|
2022/03/05 19:37:17 [INFO ]init.go:30: /api/v1/game_card/banner
|
||||||
|
2022/03/05 19:37:18 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:18 [INFO ]init.go:30: /api/v1/store/list
|
||||||
|
2022/03/05 19:37:18 [INFO ]init.go:30: /api/v1/game_card/list
|
||||||
|
2022/03/05 19:37:19 [INFO ]init.go:30: /api/v1/order/list
|
||||||
|
2022/03/05 19:37:23 [INFO ]init.go:30: /api/v1/mall/order/list
|
||||||
|
2022/03/05 19:45:24 [INFO ]init.go:30: /api/v1/mall/order/list
|
2159
pack/log_server/server.2022-03-06.log
Normal file
2159
pack/log_server/server.2022-03-06.log
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -162,10 +162,13 @@ func ConfigAppRouter(r gin.IRouter) {
|
||||||
mall.POST("goods/list", controller.MallGoodsList) // 商品-列表
|
mall.POST("goods/list", controller.MallGoodsList) // 商品-列表
|
||||||
mall.POST("goods/detail", controller.MallGoodsDetail) // 商品-详情
|
mall.POST("goods/detail", controller.MallGoodsDetail) // 商品-详情
|
||||||
|
|
||||||
mall.POST("order/create", controller.MallOrderCreate) // 订单-创建(下单)
|
mall.Use(auth.UserAccessAuth)
|
||||||
mall.POST("order/pay", controller.MallOrderPay) // 订单-支付
|
mall.POST("order/create", controller.MallOrderCreate) // 订单-创建(下单)
|
||||||
mall.POST("order/list", controller.MallOrderList) // 订单-列表
|
mall.POST("order/pay", controller.MallOrderPay) // 订单-支付
|
||||||
mall.POST("order/detail", controller.MallOrderDetail) // 订单-详情
|
mall.POST("order/list", controller.MallOrderList) // 订单-列表
|
||||||
|
mall.POST("order/detail", controller.MallOrderDetail) // 订单-详情
|
||||||
|
mall.POST("user/vm_record", controller.MallUserVmRecord) // 用户-积分记录
|
||||||
|
mall.POST("order/confirm_receipt", controller.MallGoodsOrderConfirmReceipt) // 用户-确认收货
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user