1
This commit is contained in:
@@ -66,15 +66,39 @@ func TestFulllDiscountShippingFeeList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRetailDiscountBatchSave(t *testing.T) {
|
||||
result, _, err := api.RetailDiscountBatchSave2("18822904", 0, []*RetailDiscountActData{
|
||||
result, _, err := api.RetailDiscountBatchSave2("18702580", RetailActTypeDirectDown, []*RetailDiscountActData{
|
||||
&RetailDiscountActData{
|
||||
AppFoodCode: "6094573",
|
||||
StartTime: time.Now().Unix(),
|
||||
EndTime: time.Now().Add(24 * time.Hour).Unix(),
|
||||
OrderLimit: 1,
|
||||
DayLimit: 9999,
|
||||
SettingType: SettingTypeAsDiscount,
|
||||
DiscountCoefficient: 9,
|
||||
AppFoodCode: "6045386",
|
||||
UserType: 0,
|
||||
StartTime: 1705593600,
|
||||
EndTime: 1717171199,
|
||||
OrderLimit: 1,
|
||||
DayLimit: -1,
|
||||
SettingType: 1,
|
||||
ActPrice: 0.5,
|
||||
Sequence: 1,
|
||||
},
|
||||
&RetailDiscountActData{
|
||||
AppFoodCode: "30700",
|
||||
UserType: 0,
|
||||
StartTime: 1705593600,
|
||||
EndTime: 1717171199,
|
||||
OrderLimit: 1,
|
||||
DayLimit: -1,
|
||||
SettingType: 1,
|
||||
ActPrice: 0.8,
|
||||
Sequence: 2,
|
||||
},
|
||||
&RetailDiscountActData{
|
||||
AppFoodCode: "30686",
|
||||
UserType: 0,
|
||||
StartTime: 1705593600,
|
||||
EndTime: 1717171199,
|
||||
OrderLimit: 1,
|
||||
DayLimit: -1,
|
||||
SettingType: 1,
|
||||
ActPrice: 1,
|
||||
Sequence: 3,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -145,6 +146,10 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
}
|
||||
signURL := a.genURL(cmd) + "?"
|
||||
params[signKey] = a.signParams(signURL, params)
|
||||
if cmd == "act/retail/discount/batchsave" {
|
||||
globals.SugarLogger.Debugf("========key := %s", params[signKey])
|
||||
globals.SugarLogger.Debugf("========key := %s", utils.Format4Output(params, false))
|
||||
}
|
||||
//globals.SugarLogger.Debugf("test mtCancelAct cmd=%s sig=%s", cmd, utils.Format4Output(params, false))
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||
func() *http.Request {
|
||||
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_qO_Kv9pX4lHVTb2IX19JzQ") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_qO_Kv9pX4lHVTb2IX19JzQ") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user