- CloseStatus不能添加omitempty标志,因为0是有意义的值

This commit is contained in:
gazebo
2019-09-19 17:25:47 +08:00
parent 23f548047a
commit 521a6f0661

View File

@@ -78,7 +78,7 @@ type OpStoreParams struct {
CoordinateType int `json:"coordinateType,omitempty"` // 返回值无,使用的地图类型(1,谷歌), (2,百度), (3,高德), (4,腾讯)
DeliveryRangeRadius int `json:"deliveryRangeRadius,omitempty"` // 返回值无,时效服务范围半径(单位:米)如果服务范围为类型3的话该字段有值
CoordinatePoints string `json:"coordinatePoints,omitempty"` // 返回值无坐标点集合如果服务范围为类型2的话该字段有值每个点以经度,纬度 的格式表示,用“;”隔开多个点对于腾讯地图、谷歌地图和高德地图整个coordinatePoints的长度必须小于2k对于百度地图整个coordinatePoints的长度必须小于1k
CloseStatus int `json:"closeStatus,omitempty"`
CloseStatus int `json:"closeStatus"`
StoreNotice string `json:"storeNotice,omitempty"`
StandByPhone string `json:"standByPhone,omitempty"`
}
@@ -287,8 +287,12 @@ func (a *API) UpdateStoreInfo4Open(storeNo, userName string, addParams map[strin
return err
}
func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams) (err error) {
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", utils.Struct2MapByJson(updateParams), nil, nil, nullResultParser)
func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStatus bool) (err error) {
mapData := utils.Struct2MapByJson(updateParams)
if !modifyCloseStatus {
delete(mapData, "closeStatus")
}
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", mapData, nil, nil, nullResultParser)
return err
}