- 优化net_spider

This commit is contained in:
gazebo
2019-09-11 11:54:54 +08:00
parent 85c8354873
commit f2a1cff346
4 changed files with 35 additions and 18 deletions

View File

@@ -27,12 +27,9 @@ func (c *PurchaseHandler) GetStoreIDListByCoordinates(ctx *jxcontext.Context, co
return storeIDList, nil
}
func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, cityInfo, storeID string) (storePageInfo *model.PageShop, err error) {
func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, storeID string) (storePageInfo *model.PageShop, err error) {
shopInfo, err2 := api.JdPageAPI.GetStoreInfo2(storeID)
if err = err2; err == nil && shopInfo != nil {
var lng, lat float64
districtCode := 0
lng, lat, districtCode = api.AutonaviAPI.GetCoordinateFromAddress(shopInfo.StoreInfo.StoreAddress, cityInfo)
return &model.PageShop{
Name: shopInfo.StoreInfo.StoreName,
VendorID: model.VendorIDJD,
@@ -41,9 +38,9 @@ func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, cityInfo, sto
VendorStatus: utils.Int2Str(shopInfo.StoreInfo.StationStatus),
Address: shopInfo.StoreInfo.StoreAddress,
Lng: lng,
Lat: lat,
DistrictCode: districtCode,
Lng: 0,
Lat: 0,
DistrictCode: 0,
Tel1: shopInfo.StoreInfo.StoreTel,