Merge branch 'master' of https://e.coding.net/rosydev/baseapi
This commit is contained in:
@@ -131,6 +131,7 @@ type RetailDiscountActData struct {
|
||||
Stock int `json:"stock,omitempty"` // 当日剩余活动商品数量。只有当发起查询时间处于活动生效时段内时(start_time、end_time、period、weeks_time均需满足),该字段才代表实际剩余活动商品数量,否则显示的是创建活动时规定的当日活动库存
|
||||
Status int `json:"status,omitempty"` // 活动状态,0:已过期,1:已生效,2:待生效。
|
||||
Name string `json:"name,omitempty"`
|
||||
SkuId string `json:"sku_id"` // 京西商品id
|
||||
}
|
||||
|
||||
type RetailDiscountActResult struct {
|
||||
@@ -397,6 +398,7 @@ func (a *API) RetailDiscountList(poiCode string, actType int) (actList []*Retail
|
||||
actType = RetailActTypeDirectDown
|
||||
}
|
||||
for {
|
||||
|
||||
result, err := a.AccessAPI("act/retail/discount/list", true, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"act_type": actType,
|
||||
@@ -441,7 +443,7 @@ func (a *API) RetailDiscountDelete2(poiCode string, actType int, actIDList []str
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
func (a *API) RetailDiscountDelete(poiCode string, actType int, actIDList []string) (err error) {
|
||||
func (a *API) RetailiscountDelete(poiCode string, actType int, actIDList []string) (err error) {
|
||||
_, err = a.RetailDiscountDelete2(poiCode, actType, actIDList)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -154,18 +155,14 @@ func TestRetailDiscountBatchSave(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRetailDiscountList(t *testing.T) {
|
||||
result, err := api.RetailDiscountList("8040309", RetailActTypeDirectDown)
|
||||
result, err := api.RetailDiscountList("8694203", RetailActTypeSecKill)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestRetailDiscountDelete(t *testing.T) {
|
||||
err := api.RetailDiscountDelete(testPoiCode, RetailActTypeDirectDown, []string{"329187452"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
for _, v := range result {
|
||||
globals.SugarLogger.Debugf("%s", utils.Format4Output(v, false))
|
||||
}
|
||||
//t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestInStoreCouponList(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user