Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson
2023-08-22 13:43:41 +08:00
13 changed files with 42 additions and 21 deletions

View File

@@ -5,10 +5,11 @@ import (
"fusenapi/model/gmodel"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"gorm.io/gorm"
"strings"
"time"
"gorm.io/gorm"
"context"
"fusenapi/server/shopping-cart-confirmation/internal/svc"
@@ -101,7 +102,7 @@ func (l *CartAddLogic) CartAdd(req *types.CartAddReq, userinfo *auth.UserInfo) (
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get cart info")
}
now := time.Now().Unix()
nowTime := time.Now()
nowTime := time.Now().UTC()
data := gmodel.FsCart{
UserId: &userinfo.UserId,
ProductId: productPriceInfo.ProductId,

View File

@@ -1,7 +1,6 @@
package logic
import (
"errors"
"fmt"
"fusenapi/model/gmodel"
"fusenapi/utils/auth"
@@ -9,11 +8,12 @@ import (
"fusenapi/utils/format"
"fusenapi/utils/id_generator"
"fusenapi/utils/step_price"
"gorm.io/gorm"
"math"
"strings"
"time"
"gorm.io/gorm"
"context"
"fusenapi/server/shopping-cart-confirmation/internal/svc"
@@ -109,7 +109,7 @@ func (l *CreateOrderLogic) CreateOrder(req *types.CreateOrderReq, userinfo *auth
for _, cart := range cartList {
priceIndex, ok := mapPrice[*cart.PriceId]
if !ok {
return errors.New(fmt.Sprintf("price info is not exists,id = %d", *cart.PriceId))
return fmt.Errorf("price info is not exists,id = %d", *cart.PriceId)
}
//订单详情模板数据
orderDetailTemplateSn, err := id_generator.GenSnowFlakeId()