当输入的饿百门店ID不能正常转为整数时,报错

This commit is contained in:
gazebo
2019-11-01 14:35:51 +08:00
parent 7d76db62dc
commit 099fe6189f

View File

@@ -80,7 +80,10 @@ func getCoordintate(data interface{}) float64 {
}
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string) (*dao.StoreDetail, error) {
baiduShopID := utils.Str2Int64(vendorStoreID)
baiduShopID := utils.Str2Int64WithDefault(vendorStoreID, 0)
if baiduShopID == 0 {
return nil, fmt.Errorf("饿百门店ID:%s非法应该是一个整数", vendorStoreID)
}
result, err := api.EbaiAPI.ShopGet("", baiduShopID)
if err == nil {
// globals.SugarLogger.Debug(utils.Format4Output(result, false))