1
This commit is contained in:
@@ -289,36 +289,36 @@ func TestRetailSkuSellStatus(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRetailSellStatus(t *testing.T) {
|
func TestRetailSellStatus(t *testing.T) {
|
||||||
result, err := api.RetailSellStatus(utils.GetUUID(), testPoiCode, []*BareStoreFoodInfo{
|
result, err := api.RetailSellStatus(utils.GetUUID(), "666975", []*BareStoreFoodInfo{
|
||||||
&BareStoreFoodInfo{
|
&BareStoreFoodInfo{
|
||||||
AppFoodCode: "2212",
|
AppFoodCode: "6096035",
|
||||||
Skus: []*BareStoreSkuInfo{
|
Skus: []*BareStoreSkuInfo{
|
||||||
&BareStoreSkuInfo{
|
&BareStoreSkuInfo{
|
||||||
SkuID: "2212",
|
SkuID: "6096035",
|
||||||
Price: "1.2",
|
Price: "2.1",
|
||||||
Stock: "123",
|
Stock: "0",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&BareStoreFoodInfo{
|
//&BareStoreFoodInfo{
|
||||||
AppFoodCode: "23840",
|
// AppFoodCode: "23840",
|
||||||
Skus: []*BareStoreSkuInfo{
|
// Skus: []*BareStoreSkuInfo{
|
||||||
&BareStoreSkuInfo{
|
// &BareStoreSkuInfo{
|
||||||
SkuID: "23840",
|
// SkuID: "23840",
|
||||||
Stock: "123",
|
// Stock: "123",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
},
|
//},
|
||||||
&BareStoreFoodInfo{
|
//&BareStoreFoodInfo{
|
||||||
AppFoodCode: "2384999",
|
// AppFoodCode: "2384999",
|
||||||
Skus: []*BareStoreSkuInfo{
|
// Skus: []*BareStoreSkuInfo{
|
||||||
&BareStoreSkuInfo{
|
// &BareStoreSkuInfo{
|
||||||
SkuID: "2384999",
|
// SkuID: "2384999",
|
||||||
Stock: "123",
|
// Stock: "123",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
},
|
//},
|
||||||
}, SellStatusOnline)
|
}, SellStatusOffline)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,25 +46,25 @@ func (c *SkuSyncStockRequest) GetParams() *SkuSyncStockParam {
|
|||||||
|
|
||||||
type SkuSyncStockParam struct {
|
type SkuSyncStockParam struct {
|
||||||
// sku编码
|
// sku编码
|
||||||
Code string `json:"code"`
|
//Code string `json:"code"`
|
||||||
// 规格id;抖店系统生成,商品id下唯一。
|
// 规格id;抖店系统生成,商品id下唯一。
|
||||||
SkuId int64 `json:"sku_id"`
|
//SkuId int64 `json:"sku_id"`
|
||||||
// 外部skuid,开发者在创建或更新商品时设置。
|
// 外部skuid,开发者在创建或更新商品时设置。
|
||||||
OutSkuId int64 `json:"out_sku_id"`
|
OutSkuId int64 `json:"out_sku_id"`
|
||||||
// 商品ID,抖店系统生成,店铺下唯一;长度19位。
|
// 商品ID,抖店系统生成,店铺下唯一;长度19位。
|
||||||
ProductId int64 `json:"product_id"`
|
ProductId int64 `json:"product_id"`
|
||||||
// 外部商品id;开发者在创建或更新商品时设置的。
|
// 外部商品id;开发者在创建或更新商品时设置的。
|
||||||
OutProductId int64 `json:"out_product_id"`
|
//OutProductId int64 `json:"out_product_id"`
|
||||||
// 外部仓库id编码,开发者自定义;如传入传值表示更新区域库存,不传默认更新普通库存。可以使用【/warehouse/list】接口响应参数【out_warehouse_id】字段获取。超市小时达店铺类型,需传入store_id字段,store_id可以使用【/shop/batchCreateStore】创建成功后获取
|
// 外部仓库id编码,开发者自定义;如传入传值表示更新区域库存,不传默认更新普通库存。可以使用【/warehouse/list】接口响应参数【out_warehouse_id】字段获取。超市小时达店铺类型,需传入store_id字段,store_id可以使用【/shop/batchCreateStore】创建成功后获取
|
||||||
OutWarehouseId string `json:"out_warehouse_id"`
|
//OutWarehouseId string `json:"out_warehouse_id"`
|
||||||
// 供应商ID
|
// 供应商ID
|
||||||
SupplierId string `json:"supplier_id"`
|
//SupplierId string `json:"supplier_id"`
|
||||||
// 库存更新方式;true-增量更新,同时idempotent_id字段必填;false-全量更新;默认为false
|
// 库存更新方式;true-增量更新,同时idempotent_id字段必填;false-全量更新;默认为false
|
||||||
Incremental bool `json:"incremental"`
|
Incremental bool `json:"incremental"`
|
||||||
// 幂等ID,当incremental=true时该参数必传
|
// 幂等ID,当incremental=true时该参数必传
|
||||||
IdempotentId string `json:"idempotent_id"`
|
//IdempotentId string `json:"idempotent_id"`
|
||||||
// 库存值;可以设置为0;
|
// 库存值;可以设置为0;
|
||||||
StockNum int64 `json:"stock_num"`
|
StockNum int64 `json:"stock_num"`
|
||||||
// 阶梯库存
|
// 阶梯库存
|
||||||
StepStockNum int64 `json:"step_stock_num"`
|
//StepStockNum int64 `json:"step_stock_num"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
// "authority_id": ""
|
// "authority_id": ""
|
||||||
//}`
|
//}`
|
||||||
|
|
||||||
var token = `{"access_token":"84b9ab00-68d0-4b9f-9682-a03f75eaed95","expires_in":1672634978,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"44b1e11e-90a0-4876-b5f9-edd2bf5820e8","authority_id":""}`
|
var token = `{"access_token":"adea9f19-9f8d-4656-8eb3-03c91385252f","expires_in":1673237952,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"ab14e321-1a68-405c-b904-7c4c14222c58","authority_id":""}`
|
||||||
|
|
||||||
//var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}`
|
//var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}`
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import (
|
|||||||
superm_product_batchRedistributeStoreProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_batchRedistributeStoreProduct/request"
|
superm_product_batchRedistributeStoreProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_batchRedistributeStoreProduct/request"
|
||||||
superm_product_createSubProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_createSubProduct/request"
|
superm_product_createSubProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_createSubProduct/request"
|
||||||
superm_product_launchProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_launchProduct/request"
|
superm_product_launchProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_launchProduct/request"
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -502,6 +503,7 @@ func (a *API) CreateSubProduct(mainProductId int64, storeId int64) (int64, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
if result.Code != RequestSuccessCode {
|
if result.Code != RequestSuccessCode {
|
||||||
|
globals.SugarLogger.Debugf("=CreateSubProduct logID ========= %s", utils.Format4Output(result, false))
|
||||||
return 0, errors.New(result.SubMsg)
|
return 0, errors.New(result.SubMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,17 +62,10 @@ func TestGetSkuDetailLocalId(t *testing.T) {
|
|||||||
|
|
||||||
func TestUpdateSkuStore(t *testing.T) {
|
func TestUpdateSkuStore(t *testing.T) {
|
||||||
err := a.UpdateSkuStock(&sku_syncStock_request.SkuSyncStockParam{
|
err := a.UpdateSkuStock(&sku_syncStock_request.SkuSyncStockParam{
|
||||||
SkuId: 1747916594479148,
|
ProductId: 3592147984177100181,
|
||||||
ProductId: 3579733194175557759,
|
OutSkuId: 29170,
|
||||||
OutProductId: 0,
|
|
||||||
Incremental: false,
|
|
||||||
IdempotentId: "",
|
|
||||||
StockNum: 2,
|
StockNum: 2,
|
||||||
OutWarehouseId: "65402632",
|
Incremental: false,
|
||||||
Code: "",
|
|
||||||
OutSkuId: 0,
|
|
||||||
SupplierId: "",
|
|
||||||
StepStockNum: 0,
|
|
||||||
})
|
})
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
@@ -149,12 +142,13 @@ func TestBatchDecrypt(t *testing.T) {
|
|||||||
// a.OrderUserInfoSensitive("4988354190732430566")
|
// a.OrderUserInfoSensitive("4988354190732430566")
|
||||||
//}
|
//}
|
||||||
|
|
||||||
func TestGetSkuList(t *testing.T) {
|
// 删除已经创建商品,重新同步
|
||||||
|
func TestDeleteSkuAndUploadSku(t *testing.T) {
|
||||||
var errList = make([]error, 0, 0)
|
var errList = make([]error, 0, 0)
|
||||||
for i := 1; i < 100; i++ {
|
for i := 1; i < 100; i++ {
|
||||||
result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{
|
result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{
|
||||||
Status: 0,
|
Status: 0,
|
||||||
CheckStatus: 4, // 1 2 3 4 5 7
|
CheckStatus: 7, // 1 2 3 4 5 7
|
||||||
ProductType: 0,
|
ProductType: 0,
|
||||||
StartTime: 0,
|
StartTime: 0,
|
||||||
EndTime: 0,
|
EndTime: 0,
|
||||||
@@ -162,7 +156,7 @@ func TestGetSkuList(t *testing.T) {
|
|||||||
Size: 100,
|
Size: 100,
|
||||||
UpdateStartTime: 0,
|
UpdateStartTime: 0,
|
||||||
UpdateEndTime: 0,
|
UpdateEndTime: 0,
|
||||||
StoreId: 63521394,
|
StoreId: 63462817,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debugf("=index := %d ,err := %s", i, utils.Format4Output(err, false))
|
globals.SugarLogger.Debugf("=index := %d ,err := %s", i, utils.Format4Output(err, false))
|
||||||
|
|||||||
Reference in New Issue
Block a user