This commit is contained in:
邹宗楠
2023-02-24 16:59:07 +08:00
parent 6eac242b06
commit 719507863a
4 changed files with 38 additions and 40 deletions

View File

@@ -4,6 +4,7 @@ package jdapi
import (
"encoding/json"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
)
const (
@@ -337,6 +338,8 @@ func (a *API) GetStoreInfoByStationNo2(storeNo string) (storeDetail *StoreDetail
// }
func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStatus bool) (err error) {
globals.SugarLogger.Debugf("=updateParams=========: %s", utils.Format4Output(updateParams, false))
globals.SugarLogger.Debugf("=modifyCloseStatus=========: %s", utils.Format4Output(modifyCloseStatus, false))
updateParams.Operator = utils.GetAPIOperator(updateParams.Operator)
mapData := utils.Struct2MapByJson(updateParams)
if !modifyCloseStatus {
@@ -357,6 +360,7 @@ func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStat
delete(mapData, "serviceTimeEnd1")
}
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", mapData, nil, nil, nullResultParser)
globals.SugarLogger.Debugf("=err=========: %s", utils.Format4Output(err, false))
return err
}

View File

@@ -49,36 +49,36 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
}
//
//func TestUpdateStoreInfo4Open(t *testing.T) {
// result, err := api.GetStoreInfoByStationNo2(mustExistStoreID)
// if err != nil {
// t.Fatal(err)
// }
// oldAddress := result.StationAddress
// params := &OpStoreParams{
// StationNo: mustExistStoreID,
// Operator: "test",
// StationAddress: oldAddress + "T",
// }
// err = api.UpdateStoreInfo4Open2(params, false)
// if err != nil {
// t.Fatal(err)
// }
//
// result, err = api.GetStoreInfoByStationNo2(mustExistStoreID)
// newAddress := result.StationAddress
// if newAddress != params.StationAddress {
// t.Fatalf("address not match, newAddress:%s, oldAddress:%s", newAddress, oldAddress)
// }
//
// params.StationAddress = oldAddress
// api.UpdateStoreInfo4Open2(params, false)
// if err != nil {
// t.Fatal(err)
// }
//}
//
func TestUpdateStoreInfo4Open(t *testing.T) {
params := &OpStoreParams{
StationNo: "12664100",
StationName: "",
OutSystemID: "",
Mobile: "",
Phone: "",
Lat: 43.622098,
Lng: 122.275918,
StationAddress: "内蒙古自治区通辽市科尔沁区百花新城",
Operator: "liulei",
ServiceTimeEnd1: 0,
ServiceTimeStart1: 0,
ServiceTimeEnd2: 0,
ServiceTimeStart2: 0,
DeliveryRangeType: 0,
CoordinateType: 0,
DeliveryRangeRadius: 0,
CoordinatePoints: "",
CloseStatus: 0,
StoreNotice: "",
StandByPhone: "",
}
err := api.UpdateStoreInfo4Open2(params, false)
if err != nil {
t.Fatal(err)
}
}
//func TestGetCommentByOrderId(t *testing.T) {
// testOrderID := int64(922520919000622)
// result, err := api.GetCommentByOrderId2(testOrderID)