Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
fdd6ac9b44
|
@ -28,6 +28,9 @@ type ResourceInfoReq struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type LogoCombineReq struct {
|
type LogoCombineReq struct {
|
||||||
|
LogoUrl string `json:"logo_url"` // 合图参数
|
||||||
|
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
||||||
|
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
|
||||||
TemplateId int64 `json:"template_id"` // 合图参数
|
TemplateId int64 `json:"template_id"` // 合图参数
|
||||||
TemplateTag string `json:"template_tag"` // 合图参数
|
TemplateTag string `json:"template_tag"` // 合图参数
|
||||||
Website string `json:"website,optional"` // 合图参数
|
Website string `json:"website,optional"` // 合图参数
|
||||||
|
@ -35,9 +38,6 @@ type LogoCombineReq struct {
|
||||||
Address string `json:"address,optional"` // 合图参数
|
Address string `json:"address,optional"` // 合图参数
|
||||||
Phone string `json:"phone,optional"` // 合图参数
|
Phone string `json:"phone,optional"` // 合图参数
|
||||||
Qrcode string `json:"qrcode,optional"` // 合图参数
|
Qrcode string `json:"qrcode,optional"` // 合图参数
|
||||||
LogoUrl string `json:"logo_url"` // 合图参数
|
|
||||||
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
|
||||||
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type TemplateTagColor struct {
|
type TemplateTagColor struct {
|
||||||
|
|
|
@ -19,6 +19,7 @@ AWS:
|
||||||
Secret: sjCEv0JxATnPCxno2KNLm0X8oDc7srUR+4vkYhvm
|
Secret: sjCEv0JxATnPCxno2KNLm0X8oDc7srUR+4vkYhvm
|
||||||
Token:
|
Token:
|
||||||
BLMService:
|
BLMService:
|
||||||
|
Version: "2"
|
||||||
Url: "http://18.119.109.254:8999"
|
Url: "http://18.119.109.254:8999"
|
||||||
# Url: "http://192.168.1.9:8999"
|
# Url: "http://192.168.1.9:8999"
|
||||||
ImageProcess:
|
ImageProcess:
|
||||||
|
|
|
@ -22,6 +22,7 @@ type Config struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BLMService struct {
|
BLMService struct {
|
||||||
|
Version string
|
||||||
Url string
|
Url string
|
||||||
ImageProcess struct {
|
ImageProcess struct {
|
||||||
Url string
|
Url string
|
||||||
|
|
|
@ -171,12 +171,9 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
|
||||||
logoHeight = 200
|
logoHeight = 200
|
||||||
}
|
}
|
||||||
var resultStr string
|
var resultStr string
|
||||||
|
|
||||||
var postMap = make(map[string]string, 1)
|
|
||||||
postMap["logo_url"] = logoUrl
|
|
||||||
|
|
||||||
resLogoStandard, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{
|
resLogoStandard, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{
|
||||||
LogoUrl: logoUrl,
|
LogoUrl: logoUrl,
|
||||||
|
Version: l.svcCtx.Config.BLMService.Version,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -55,6 +55,9 @@ type (
|
||||||
|
|
||||||
type (
|
type (
|
||||||
LogoCombineReq {
|
LogoCombineReq {
|
||||||
|
LogoUrl string `json:"logo_url"` // 合图参数
|
||||||
|
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
||||||
|
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
|
||||||
TemplateId int64 `json:"template_id"` // 合图参数
|
TemplateId int64 `json:"template_id"` // 合图参数
|
||||||
TemplateTag string `json:"template_tag"` // 合图参数
|
TemplateTag string `json:"template_tag"` // 合图参数
|
||||||
Website string `json:"website,optional"` // 合图参数
|
Website string `json:"website,optional"` // 合图参数
|
||||||
|
@ -62,10 +65,6 @@ type (
|
||||||
Address string `json:"address,optional"` // 合图参数
|
Address string `json:"address,optional"` // 合图参数
|
||||||
Phone string `json:"phone,optional"` // 合图参数
|
Phone string `json:"phone,optional"` // 合图参数
|
||||||
Qrcode string `json:"qrcode,optional"` // 合图参数
|
Qrcode string `json:"qrcode,optional"` // 合图参数
|
||||||
LogoUrl string `json:"logo_url"` // 合图参数
|
|
||||||
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
|
||||||
|
|
||||||
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
|
|
||||||
}
|
}
|
||||||
TemplateTagColor {
|
TemplateTagColor {
|
||||||
Colors [][]string `json:"colors"` // 颜色组合
|
Colors [][]string `json:"colors"` // 颜色组合
|
||||||
|
|
|
@ -160,6 +160,7 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo
|
||||||
type (
|
type (
|
||||||
LogoInfoSetReq struct {
|
LogoInfoSetReq struct {
|
||||||
LogoUrl string `json:"logo_url"`
|
LogoUrl string `json:"logo_url"`
|
||||||
|
Version string `json:"version"`
|
||||||
}
|
}
|
||||||
LogoInfoSetRes struct {
|
LogoInfoSetRes struct {
|
||||||
Res string `json:"res"`
|
Res string `json:"res"`
|
||||||
|
@ -168,8 +169,9 @@ type (
|
||||||
|
|
||||||
func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq) (*LogoInfoSetRes, error) {
|
func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq) (*LogoInfoSetRes, error) {
|
||||||
var resultBLM constants.BLMServiceUrlResult
|
var resultBLM constants.BLMServiceUrlResult
|
||||||
postMap := make(map[string]string, 1)
|
postMap := make(map[string]string, 2)
|
||||||
postMap["logo_url"] = in.LogoUrl
|
postMap["logo_url"] = in.LogoUrl
|
||||||
|
postMap["version"] = in.Version
|
||||||
|
|
||||||
logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())
|
logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())
|
||||||
err := curl.NewClient(ctx, &curl.Config{
|
err := curl.NewClient(ctx, &curl.Config{
|
||||||
|
@ -306,7 +308,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
||||||
"color": in.TemplateTagColor.Color,
|
"color": in.TemplateTagColor.Color,
|
||||||
"index": in.TemplateTagColor.Index,
|
"index": in.TemplateTagColor.Index,
|
||||||
}
|
}
|
||||||
var postMap = make(map[string]interface{}, 2)
|
var postMap = make(map[string]interface{}, 3)
|
||||||
postMap["module_data"] = moduleDataMap
|
postMap["module_data"] = moduleDataMap
|
||||||
postMap["tag_data"] = in.ProductTemplateTagGroups
|
postMap["tag_data"] = in.ProductTemplateTagGroups
|
||||||
postMap["param_data"] = combineParam
|
postMap["param_data"] = combineParam
|
||||||
|
|
|
@ -687,7 +687,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create
|
||||||
ntimeTimeOut := ntime.Unix()
|
ntimeTimeOut := ntime.Unix()
|
||||||
|
|
||||||
// 测试超时支付不限制
|
// 测试超时支付不限制
|
||||||
if ctimeTimeOut == ntimeTimeOut {
|
if ctimeTimeOut < ntimeTimeOut {
|
||||||
errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout
|
errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout
|
||||||
err = errors.New("order pay timeout")
|
err = errors.New("order pay timeout")
|
||||||
logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err)
|
logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err)
|
||||||
|
@ -807,11 +807,11 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create
|
||||||
func (d *defaultOrder) List(ctx context.Context, in *ListReq) (res *ListRes, err error) {
|
func (d *defaultOrder) List(ctx context.Context, in *ListReq) (res *ListRes, err error) {
|
||||||
var orderList []gmodel.FsOrder
|
var orderList []gmodel.FsOrder
|
||||||
model := d.MysqlConn.Model(&gmodel.FsOrder{}).Where("is_del = ?", 0)
|
model := d.MysqlConn.Model(&gmodel.FsOrder{}).Where("is_del = ?", 0)
|
||||||
|
model.Where("pay_status > ?", 0)
|
||||||
if in.UserId != 0 {
|
if in.UserId != 0 {
|
||||||
model.Where("user_id = ?", in.UserId)
|
model.Where("user_id = ?", in.UserId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Where("pay_status > ?", 0)
|
|
||||||
if in.DeliveryMethod != 0 {
|
if in.DeliveryMethod != 0 {
|
||||||
model.Where("delivery_method = ?", in.DeliveryMethod)
|
model.Where("delivery_method = ?", in.DeliveryMethod)
|
||||||
}
|
}
|
||||||
|
@ -1016,8 +1016,13 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
|
||||||
return errors.New("shoppingCartProductModel3d.StepPrice nil")
|
return errors.New("shoppingCartProductModel3d.StepPrice nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var fittingPrice int64
|
||||||
|
if shoppingCart.ShoppingCartProductModel3dFitting != nil {
|
||||||
|
fittingPrice = *shoppingCart.ShoppingCartProductModel3dFitting.Price
|
||||||
|
}
|
||||||
|
|
||||||
/* 计算价格 */
|
/* 计算价格 */
|
||||||
productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, *shoppingCart.ShoppingCartProductModel3dFitting.Price)
|
productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, fittingPrice)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorCode = *basic.CodeErrOrderCreatProductPriceAbsent
|
errorCode = *basic.CodeErrOrderCreatProductPriceAbsent
|
||||||
errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed"
|
errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed"
|
||||||
|
|
|
@ -5,9 +5,10 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
"fusenapi/utils/hash"
|
"fusenapi/utils/hash"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewShoppingCart(gormDB *gorm.DB, bLMServiceUrl *string, awsSession *session.Session) ShoppingCart {
|
func NewShoppingCart(gormDB *gorm.DB, bLMServiceUrl *string, awsSession *session.Session) ShoppingCart {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user