yb
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package yb
|
package yb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
|
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -17,6 +19,7 @@ var (
|
|||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
storeSku := storeSkuList[0]
|
storeSku := storeSkuList[0]
|
||||||
|
fmt.Println(utils.Format4Output(storeSku, false))
|
||||||
api.YinBaoAPI = yinbaoapi.New(storeSku.YbAppKey, storeSku.YbAppID)
|
api.YinBaoAPI = yinbaoapi.New(storeSku.YbAppKey, storeSku.YbAppID)
|
||||||
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -32,8 +35,8 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
|||||||
|
|
||||||
func buildProductInfoParam(storeSku *dao.StoreSkuSyncInfo) (productInfoParam *yinbaoapi.ProductInfoParam) {
|
func buildProductInfoParam(storeSku *dao.StoreSkuSyncInfo) (productInfoParam *yinbaoapi.ProductInfoParam) {
|
||||||
var (
|
var (
|
||||||
buyPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.Price))
|
buyPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.Price)) / 100
|
||||||
sellPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.VendorPrice))
|
sellPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.VendorPrice)) / 100
|
||||||
)
|
)
|
||||||
productInfoParam = &yinbaoapi.ProductInfoParam{}
|
productInfoParam = &yinbaoapi.ProductInfoParam{}
|
||||||
productInfo := &yinbaoapi.ProductInfo{
|
productInfo := &yinbaoapi.ProductInfo{
|
||||||
|
|||||||
Reference in New Issue
Block a user