fix
This commit is contained in:
parent
af35164fb2
commit
8d4901cdcd
|
@ -242,17 +242,18 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
||||||
snapshotJsonStr := string(snapshotJsonBytes)
|
snapshotJsonStr := string(snapshotJsonBytes)
|
||||||
now := time.Now().UTC()
|
now := time.Now().UTC()
|
||||||
err = l.svcCtx.AllModels.FsShoppingCart.Create(l.ctx, &gmodel.FsShoppingCart{
|
err = l.svcCtx.AllModels.FsShoppingCart.Create(l.ctx, &gmodel.FsShoppingCart{
|
||||||
UserId: &userinfo.UserId,
|
UserId: &userinfo.UserId,
|
||||||
ProductId: &req.ProductId,
|
ProductId: &req.ProductId,
|
||||||
TemplateId: &req.TemplateId,
|
TemplateId: &req.TemplateId,
|
||||||
ModelId: &modelInfo.Id,
|
ModelId: &modelInfo.Id,
|
||||||
LightId: modelInfo.Light,
|
IsHighlyCustomized: &req.IsHighlyCustomized,
|
||||||
SizeId: &req.SizeId,
|
LightId: modelInfo.Light,
|
||||||
FittingId: &req.FittingId,
|
SizeId: &req.SizeId,
|
||||||
PurchaseQuantity: &req.PurchaseQuantity,
|
FittingId: &req.FittingId,
|
||||||
Snapshot: &snapshotJsonStr,
|
PurchaseQuantity: &req.PurchaseQuantity,
|
||||||
Ctime: &now,
|
Snapshot: &snapshotJsonStr,
|
||||||
Utime: &now,
|
Ctime: &now,
|
||||||
|
Utime: &now,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
|
|
|
@ -197,7 +197,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||||
PurchaseQuantity: *cart.PurchaseQuantity,
|
PurchaseQuantity: *cart.PurchaseQuantity,
|
||||||
MinPurchaseQuantity: stepPrice.MinBuyUnitsNum,
|
MinPurchaseQuantity: stepPrice.MinBuyUnitsNum,
|
||||||
StepPurchaseQuantity: stepPurchaseQuantity,
|
StepPurchaseQuantity: stepPurchaseQuantity,
|
||||||
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
|
IsHighlyCustomized: *cart.IsHighlyCustomized,
|
||||||
IsSelected: cartIsSelected,
|
IsSelected: cartIsSelected,
|
||||||
TemplateTag: templateTag,
|
TemplateTag: templateTag,
|
||||||
Logo: snapShot.Logo,
|
Logo: snapShot.Logo,
|
||||||
|
|
|
@ -6,16 +6,17 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type AddToCartReq struct {
|
type AddToCartReq struct {
|
||||||
ProductId int64 `json:"product_id"` //产品id
|
ProductId int64 `json:"product_id"` //产品id
|
||||||
TemplateId int64 `json:"template_id,optional"` //模板id(不可定制的不传)
|
TemplateId int64 `json:"template_id,optional"` //模板id(不可定制的不传)
|
||||||
SelectColorIndex int64 `json:"select_color_index"` //选择的颜色索引
|
IsHighlyCustomized int64 `json:"is_highly_customized"` //是否高度定制
|
||||||
SizeId int64 `json:"size_id"` //尺寸id
|
SelectColorIndex int64 `json:"select_color_index"` //选择的颜色索引
|
||||||
FittingId int64 `json:"fitting_id,optional"` //配件id(没有可以不传)
|
SizeId int64 `json:"size_id"` //尺寸id
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
|
FittingId int64 `json:"fitting_id,optional"` //配件id(没有可以不传)
|
||||||
Logo string `json:"logo,optional"` //logo地址(没有可以不传)
|
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
|
||||||
CombineImage string `json:"combine_image,optional"` //合图地址 (没有可以不传)
|
Logo string `json:"logo,optional"` //logo地址(没有可以不传)
|
||||||
RenderImage string `json:"render_image,optional"` //渲染结果图 (没有可以不传)
|
CombineImage string `json:"combine_image,optional"` //合图地址 (没有可以不传)
|
||||||
DiyInfo DiyInfo `json:"diy_info,optional"` //用户diy数据(可选)
|
RenderImage string `json:"render_image,optional"` //渲染结果图 (没有可以不传)
|
||||||
|
DiyInfo DiyInfo `json:"diy_info,optional"` //用户diy数据(可选)
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiyInfo struct {
|
type DiyInfo struct {
|
||||||
|
@ -50,7 +51,7 @@ type CartItem struct {
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
||||||
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
||||||
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
||||||
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
IsHighlyCustomized int64 `json:"is_highly_customized"` //是否高度定制
|
||||||
IsInvalid bool `json:"is_invalid"` //是否无效
|
IsInvalid bool `json:"is_invalid"` //是否无效
|
||||||
InvalidDescription string `json:"invalid_description"` //无效原因
|
InvalidDescription string `json:"invalid_description"` //无效原因
|
||||||
IsSelected bool `json:"is_selected"` //是否选中
|
IsSelected bool `json:"is_selected"` //是否选中
|
||||||
|
|
|
@ -25,16 +25,17 @@ service shopping-cart {
|
||||||
|
|
||||||
//加入购物车
|
//加入购物车
|
||||||
type AddToCartReq {
|
type AddToCartReq {
|
||||||
ProductId int64 `json:"product_id"` //产品id
|
ProductId int64 `json:"product_id"` //产品id
|
||||||
TemplateId int64 `json:"template_id,optional"` //模板id(不可定制的不传)
|
TemplateId int64 `json:"template_id,optional"` //模板id(不可定制的不传)
|
||||||
SelectColorIndex int64 `json:"select_color_index"` //选择的颜色索引
|
IsHighlyCustomized int64 `json:"is_highly_customized"` //是否高度定制
|
||||||
SizeId int64 `json:"size_id"` //尺寸id
|
SelectColorIndex int64 `json:"select_color_index"` //选择的颜色索引
|
||||||
FittingId int64 `json:"fitting_id,optional"` //配件id(没有可以不传)
|
SizeId int64 `json:"size_id"` //尺寸id
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
|
FittingId int64 `json:"fitting_id,optional"` //配件id(没有可以不传)
|
||||||
Logo string `json:"logo,optional"` //logo地址(没有可以不传)
|
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
|
||||||
CombineImage string `json:"combine_image,optional"` //合图地址 (没有可以不传)
|
Logo string `json:"logo,optional"` //logo地址(没有可以不传)
|
||||||
RenderImage string `json:"render_image,optional"` //渲染结果图 (没有可以不传)
|
CombineImage string `json:"combine_image,optional"` //合图地址 (没有可以不传)
|
||||||
DiyInfo DiyInfo `json:"diy_info,optional"` //用户diy数据(可选)
|
RenderImage string `json:"render_image,optional"` //渲染结果图 (没有可以不传)
|
||||||
|
DiyInfo DiyInfo `json:"diy_info,optional"` //用户diy数据(可选)
|
||||||
}
|
}
|
||||||
type DiyInfo {
|
type DiyInfo {
|
||||||
Phone string `json:"phone,optional"` //电话(可选)
|
Phone string `json:"phone,optional"` //电话(可选)
|
||||||
|
@ -67,7 +68,7 @@ type CartItem {
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
||||||
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
||||||
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
||||||
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
IsHighlyCustomized int64 `json:"is_highly_customized"` //是否高度定制
|
||||||
IsInvalid bool `json:"is_invalid"` //是否无效
|
IsInvalid bool `json:"is_invalid"` //是否无效
|
||||||
InvalidDescription string `json:"invalid_description"` //无效原因
|
InvalidDescription string `json:"invalid_description"` //无效原因
|
||||||
IsSelected bool `json:"is_selected"` //是否选中
|
IsSelected bool `json:"is_selected"` //是否选中
|
||||||
|
|
Loading…
Reference in New Issue
Block a user