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

This commit is contained in:
momo 2023-09-27 18:01:21 +08:00
commit 4cb921853e
4 changed files with 8 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import (
"fusenapi/model/gmodel" "fusenapi/model/gmodel"
"fusenapi/utils/auth" "fusenapi/utils/auth"
"fusenapi/utils/basic" "fusenapi/utils/basic"
"fusenapi/utils/format"
"gorm.io/gorm" "gorm.io/gorm"
"strings" "strings"
@ -111,7 +112,7 @@ func (l *GetFittingByPidLogic) GetFittingByPid(req *types.GetFittingByPidReq, us
Id: fitting.Id, Id: fitting.Id,
MaterialImg: materialImg, MaterialImg: materialImg,
Title: *fitting.Title, Title: *fitting.Title,
Price: *fitting.Price, Price: format.CentitoDollar(*fitting.Price, 3),
ModelInfo: modelInfo, ModelInfo: modelInfo,
IsPopular: *fitting.IsHot > 0, IsPopular: *fitting.IsHot > 0,
}) })

View File

@ -6,6 +6,7 @@ import (
"fusenapi/constants" "fusenapi/constants"
"fusenapi/utils/auth" "fusenapi/utils/auth"
"fusenapi/utils/basic" "fusenapi/utils/basic"
"fusenapi/utils/format"
"gorm.io/gorm" "gorm.io/gorm"
"strings" "strings"
@ -116,7 +117,7 @@ func (l *GetSizeByPidLogic) GetSizeByPid(req *types.GetSizeByPidReq, userinfo *a
PartsCanDeleted: *sizeInfo.PartsCanDeleted > 0, PartsCanDeleted: *sizeInfo.PartsCanDeleted > 0,
ModelId: modelList[modelIndex].Id, ModelId: modelList[modelIndex].Id,
IsPopular: *sizeInfo.IsHot > 0, IsPopular: *sizeInfo.IsHot > 0,
MinPrice: float64(minPrice) / 100, MinPrice: format.CentitoDollar(minPrice, 3),
IsDefault: defaultSizeId == sizeInfo.Id, IsDefault: defaultSizeId == sizeInfo.Id,
}) })
} }

View File

@ -361,7 +361,7 @@ type GetSizeByPidRsp struct {
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件 PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
ModelId int64 `json:"model_id"` //产品主模型id ModelId int64 `json:"model_id"` //产品主模型id
IsPopular bool `json:"is_popular"` //是否受欢迎 IsPopular bool `json:"is_popular"` //是否受欢迎
MinPrice float64 `json:"min_price"` //最小价格 MinPrice string `json:"min_price"` //最小价格
IsDefault bool `json:"is_default"` //是否默认(这里的默认是跟列表页一致) IsDefault bool `json:"is_default"` //是否默认(这里的默认是跟列表页一致)
} }
@ -379,7 +379,7 @@ type GetFittingByPidRsp struct {
Id int64 `json:"id"` Id int64 `json:"id"`
MaterialImg string `json:"material_img"` MaterialImg string `json:"material_img"`
Title string `json:"title"` Title string `json:"title"`
Price int64 `json:"price"` Price string `json:"price"`
IsPopular bool `json:"is_popular"` IsPopular bool `json:"is_popular"`
ModelInfo interface{} `json:"model_info"` ModelInfo interface{} `json:"model_info"`
} }

View File

@ -411,7 +411,7 @@ type GetSizeByPidRsp {
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件 PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
ModelId int64 `json:"model_id"` //产品主模型id ModelId int64 `json:"model_id"` //产品主模型id
IsPopular bool `json:"is_popular"` //是否受欢迎 IsPopular bool `json:"is_popular"` //是否受欢迎
MinPrice float64 `json:"min_price"` //最小价格 MinPrice string `json:"min_price"` //最小价格
IsDefault bool `json:"is_default"` //是否默认(这里的默认是跟列表页一致) IsDefault bool `json:"is_default"` //是否默认(这里的默认是跟列表页一致)
} }
//获取产品模板 //获取产品模板
@ -428,7 +428,7 @@ type GetFittingByPidRsp {
Id int64 `json:"id"` Id int64 `json:"id"`
MaterialImg string `json:"material_img"` MaterialImg string `json:"material_img"`
Title string `json:"title"` Title string `json:"title"`
Price int64 `json:"price"` Price string `json:"price"`
IsPopular bool `json:"is_popular"` IsPopular bool `json:"is_popular"`
ModelInfo interface{} `json:"model_info"` ModelInfo interface{} `json:"model_info"`
} }