1
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package baseapi
|
||||
|
||||
//
|
||||
//import "testing"
|
||||
//
|
||||
//func TestName(t *testing.T) {
|
||||
// 3759513291714592827 3501962704238082
|
||||
// 3759512787013992796 3502015971533826
|
||||
|
||||
@@ -11,4 +11,28 @@ type SupermProductCreateSubProductResponse struct {
|
||||
type SupermProductCreateSubProductData struct {
|
||||
// 门店子商品ID
|
||||
SubProductId int64 `json:"sub_product_id"`
|
||||
// sku信息
|
||||
SubSkuInfos []SubSkuInfosItem `json:"sub_sku_infos"`
|
||||
}
|
||||
type Value struct {
|
||||
// 属性值
|
||||
ValueName string `json:"ValueName"`
|
||||
}
|
||||
type Property struct {
|
||||
// 属性名
|
||||
PropertyName string `json:"PropertyName"`
|
||||
}
|
||||
type SalePropertyValuesItem struct {
|
||||
// 属性值
|
||||
Value *Value `json:"Value"`
|
||||
// 属性名
|
||||
Property *Property `json:"Property"`
|
||||
}
|
||||
type SubSkuInfosItem struct {
|
||||
// 门店子商品skuid
|
||||
SkuId string `json:"sku_id"`
|
||||
// 外部skuid
|
||||
OuterSkuId string `json:"outer_sku_id"`
|
||||
// SKU的销售属性
|
||||
SalePropertyValues []SalePropertyValuesItem `json:"sale_property_values"`
|
||||
}
|
||||
|
||||
@@ -694,21 +694,21 @@ func (a *API) GetRecommendCategory(picParams []string) (int64, error) {
|
||||
/*--------------------------------方案二 将住上铺平铺到所有门店店中,不在使用子商品------------------------------------------------------------------------------------*/
|
||||
|
||||
// CreateSubProduct 基于店铺主品创建门店子品 (同步创建)
|
||||
func (a *API) CreateSubProduct(mainProductId int64, storeId int64) (int64, error) {
|
||||
func (a *API) CreateSubProduct(mainProductId int64, storeId int64) (int64, string, error) {
|
||||
request := superm_product_createSubProduct_request.New()
|
||||
request.Param.MainProductId = mainProductId
|
||||
request.Param.StoreId = storeId
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return 0, "", err
|
||||
}
|
||||
|
||||
if result.Code != RequestSuccessCode {
|
||||
return 0, errors.New(result.SubMsg + ":" + result.LogId)
|
||||
return 0, "", errors.New(result.SubMsg + ":" + result.LogId)
|
||||
}
|
||||
|
||||
return result.Data.SubProductId, nil
|
||||
return result.Data.SubProductId, result.Data.SubSkuInfos[0].SkuId, nil
|
||||
}
|
||||
|
||||
// BatchRedistributeStoreProduct 重新分配店铺主品对应的门店子品 (异步执行)
|
||||
|
||||
Reference in New Issue
Block a user