1
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,
|
||||
|
||||
@@ -81,5 +81,19 @@ func IsNil(i interface{}) bool {
|
||||
recover()
|
||||
}()
|
||||
vi := reflect.ValueOf(i)
|
||||
switch vi.Kind() {
|
||||
case reflect.String:
|
||||
return len(i.(string)) == 0
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
||||
return i.(int) == 0
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return i.(float64) == 0.0
|
||||
case reflect.Bool:
|
||||
return i.(bool)
|
||||
case reflect.Map:
|
||||
return len(i.(map[interface{}]interface{})) == 0
|
||||
case reflect.Slice:
|
||||
return len(i.([]interface{})) == 0
|
||||
}
|
||||
return vi.IsNil()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user