- GetAndStoreCitiesShops

This commit is contained in:
gazebo
2019-06-25 09:23:55 +08:00
parent fc5c7ae609
commit 6cfc7091d1
6 changed files with 119 additions and 1 deletions

32
controllers/net_spider.go Normal file
View File

@@ -0,0 +1,32 @@
package controllers
import (
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/netspider"
"github.com/astaxie/beego"
)
type NetSpiderController struct {
beego.Controller
}
// @Title 同步商家商品信息
// @Description 同步商家商品信息
// @Param token header string true "认证token"
// @Param vendorIDs formData string false "厂商ID列表"
// @Param cityCodes formData string false "城市列表,缺省为后台启用了的城市"
// @Param radius formData int false "区域半径单位为米缺省8000米"
// @Param gridWith formData int false "网格大小单位为米缺省为3000米"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetAndStoreCitiesShops [post]
func (c *NetSpiderController) GetAndStoreCitiesShops() {
c.callGetAndStoreCitiesShops(func(params *tNetspiderGetAndStoreCitiesShopsParams) (retVal interface{}, errCode string, err error) {
var vendorIDs, cityCodes []int
err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.CityCodes, &cityCodes)
if err == nil {
retVal, err = netspider.GetAndStoreCitiesShops(params.Ctx, vendorIDs, cityCodes, params.Radius, params.GridWith)
}
return retVal, "", err
})
}