1
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package mtwmapi
|
package mtwmapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
@@ -384,13 +383,11 @@ func (a *API) RetailDiscountBatchSave2(poiCode string, actType int, actData []*R
|
|||||||
if actType == 0 {
|
if actType == 0 {
|
||||||
actType = RetailActTypeDirectDown
|
actType = RetailActTypeDirectDown
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("RetailDiscountBatchSave2 test0129 appID=%s,secret=%s", a.appID, a.secret)
|
|
||||||
result, err := a.AccessAPI2("act/retail/discount/batchsave", false, map[string]interface{}{
|
result, err := a.AccessAPI2("act/retail/discount/batchsave", false, map[string]interface{}{
|
||||||
KeyAppPoiCode: poiCode,
|
KeyAppPoiCode: poiCode,
|
||||||
"act_data": string(utils.MustMarshal(actData)),
|
"act_data": string(utils.MustMarshal(actData)),
|
||||||
"act_type": actType,
|
"act_type": actType,
|
||||||
}, "", "")
|
}, "", "")
|
||||||
globals.SugarLogger.Debugf("RetailDiscountBatchSave2 test0129 result=%s", utils.Format4Output(result, false))
|
|
||||||
|
|
||||||
var msg string
|
var msg string
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -398,12 +395,9 @@ func (a *API) RetailDiscountBatchSave2(poiCode string, actType int, actData []*R
|
|||||||
err = utils.UnmarshalUseNumber([]byte(resultMap[resultKeySuccessMsg].(string)), &actResult)
|
err = utils.UnmarshalUseNumber([]byte(resultMap[resultKeySuccessMsg].(string)), &actResult)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
msg = utils.Interface2String(resultMap[resultKeyMsg])
|
msg = utils.Interface2String(resultMap[resultKeyMsg])
|
||||||
globals.SugarLogger.Debugf("RetailDiscountBatchSave2 test0129 msg:%v", utils.Format4Output(msg, false))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = getMsgFromError(err)
|
msg = getMsgFromError(err)
|
||||||
globals.SugarLogger.Debugf("RetailDiscountBatchSave2 test0129 err:%v", err)
|
|
||||||
}
|
}
|
||||||
failedList = parseErr4ErrList(msg)
|
failedList = parseErr4ErrList(msg)
|
||||||
return actResult, failedList, err
|
return actResult, failedList, err
|
||||||
|
|||||||
@@ -330,6 +330,12 @@ func TestRetailBatchInitData(t *testing.T) {
|
|||||||
t.Log(utils.Format4Output(failedFoods, false))
|
t.Log(utils.Format4Output(failedFoods, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSort(t *testing.T) {
|
||||||
|
data := map[int64]int64{1: 1, 2: 1, 4: 1}
|
||||||
|
data[1] = 3
|
||||||
|
fmt.Println(data)
|
||||||
|
}
|
||||||
|
|
||||||
func TestRetailSkuStock(t *testing.T) {
|
func TestRetailSkuStock(t *testing.T) {
|
||||||
result, err := api.RetailSkuStock(utils.GetUUID(), testPoiCode, []*BareStoreFoodInfo{
|
result, err := api.RetailSkuStock(utils.GetUUID(), testPoiCode, []*BareStoreFoodInfo{
|
||||||
&BareStoreFoodInfo{
|
&BareStoreFoodInfo{
|
||||||
|
|||||||
Reference in New Issue
Block a user