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