当输入的饿百门店ID不能正常转为整数时,报错
This commit is contained in:
@@ -80,7 +80,10 @@ func getCoordintate(data interface{}) float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string) (*dao.StoreDetail, error) {
|
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)
|
result, err := api.EbaiAPI.ShopGet("", baiduShopID)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
|
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||||
|
|||||||
Reference in New Issue
Block a user