Merge branch 'master' of https://e.coding.net/rosydev/baseapi
This commit is contained in:
@@ -13,12 +13,12 @@ var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token
|
||||
|
||||
// 查询售后单详情
|
||||
func TestAfsOrder(t *testing.T) {
|
||||
a.QueryAfsOrderDetail("7154266161041899779", true)
|
||||
a.QueryAfsOrderDetail("7165706329204670732", true)
|
||||
}
|
||||
|
||||
// 同意/拒绝售后单
|
||||
func TestAggreOrNotAggreAfs(t *testing.T) {
|
||||
a.AfterSaleOperate(int32(202), "7161251923629179177", "1", 0)
|
||||
a.AfterSaleOperate(int32(201), "7165706329204670732", "1", 0)
|
||||
fmt.Println("11", 8|16|32|1)
|
||||
}
|
||||
|
||||
|
||||
@@ -7828,7 +7828,6 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Code != RequestSuccessCode {
|
||||
return nil, errors.New(result.SubMsg)
|
||||
}
|
||||
@@ -8130,3 +8129,19 @@ func (a *API) GetProductUpdateRule(categoryId int64) bool {
|
||||
}
|
||||
return result.Data.AfterSaleRule.SupplyDayReturnRule.Enable
|
||||
}
|
||||
|
||||
// GetProductUpdateRule2 查询分类是否支持七天无理由退货
|
||||
func (a *API) GetProductUpdateRule2(categoryId int64) bool {
|
||||
request := product_getProductUpdateRule_request.New()
|
||||
param := request.GetParams()
|
||||
param.CategoryId = categoryId
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if result.Code != RequestSuccessCode {
|
||||
return false
|
||||
}
|
||||
return result.Data.AfterSaleRule.SupplyDayReturnRule.Enable
|
||||
}
|
||||
|
||||
@@ -62,8 +62,9 @@ func TestCreateStoreCommodity(t *testing.T) {
|
||||
FreightId: 11111, // 运费模板id
|
||||
//Weight: 0,
|
||||
//WeightUnit: 0,
|
||||
DeliveryDelayDay: DeliveryDelayDayToDay, // 现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填
|
||||
PresellType: SendGoodsTypeNow, // 0现发货/1预售发货/2阶梯发货
|
||||
DeliveryDelayDay: DeliveryDelayDayTomorrow, // 现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填
|
||||
PresellType: 1, // 0现发货/1预售发货/2阶梯发货
|
||||
PresellConfigLevel: 1, // 0现发货/1预售发货/2阶梯发货
|
||||
//PresellDelay: 0,
|
||||
//PresellEndTime: "",
|
||||
//Supply7dayReturn: 0,
|
||||
@@ -116,13 +117,16 @@ func TestCreateStoreCommodity(t *testing.T) {
|
||||
category, err := a.GetCatePropertyV2(param.CategoryLeafId)
|
||||
format := make(map[string][]*ProductFormatNewList, 0)
|
||||
for _, v := range category.Data.Data {
|
||||
if v.Required != 1 {
|
||||
continue
|
||||
}
|
||||
for _, d := range v.Options {
|
||||
formateNew := &ProductFormatNewList{
|
||||
Value: utils.Str2Int64(d.Value),
|
||||
Name: d.Name,
|
||||
DiyType: v.DiyType,
|
||||
}
|
||||
format[utils.Int64ToStr(v.CategoryId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||
format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.PropertyId)], formateNew)
|
||||
}
|
||||
}
|
||||
productFormatNew, err := json.Marshal(format)
|
||||
@@ -268,12 +272,11 @@ func TestEditStoreCommodity(t *testing.T) {
|
||||
data, _ := a.GetSkuDetail("3580251132888538614", "")
|
||||
globals.SugarLogger.Debugf("=============%s", data.ProductFormatNew)
|
||||
specPrice, _ := json.Marshal(data.SpecPrices)
|
||||
specs, _ := json.Marshal(data.Specs)
|
||||
a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{
|
||||
ProductId: 1748169491056643,
|
||||
ProductFormatNew: data.ProductFormatNew,
|
||||
SpecPrices: string(specPrice),
|
||||
Specs: string(specs),
|
||||
Specs: "重量|250g",
|
||||
Commit: true,
|
||||
})
|
||||
}
|
||||
@@ -378,3 +381,7 @@ func TestNameeeee(t *testing.T) {
|
||||
aa := `667278_/image/4229fbb12a40ddcc7a2d42728f`
|
||||
fmt.Println(strings.Contains(aa, "detail_"))
|
||||
}
|
||||
|
||||
func TestGetProductUpdateRule2(t *testing.T) {
|
||||
a.GetProductUpdateRule2(20219)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user