86 lines
3.8 KiB
Go
86 lines
3.8 KiB
Go
package controllers
|
||
|
||
import (
|
||
"git.rosy.net.cn/jx-callback/business/jxstore/initdata"
|
||
"github.com/astaxie/beego"
|
||
)
|
||
|
||
type InitDataController struct {
|
||
beego.Controller
|
||
}
|
||
|
||
// @Title 初始化place信息
|
||
// @Description 初始化place信息,要求:jde_city, jde_district, ebde_places, mtpsdeliveryprice
|
||
// @Param token header string true "认证token"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /InitPlace [post]
|
||
func (c *InitDataController) InitPlace() {
|
||
c.callInitPlace(func(params *tInitdataInitPlaceParams) (retVal interface{}, errCode string, err error) {
|
||
err = initdata.InitPlace(params.Ctx)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 初始化skuname(当前主要是计算md5)
|
||
// @Description 初始化skuname(当前主要是计算md5)
|
||
// @Param token header string true "认证token"
|
||
// @Param isForce formData bool false "是否强刷,即即使本地已经有了hashCode也重新计算,缺省为false"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /InitSkuName [post]
|
||
func (c *InitDataController) InitSkuName() {
|
||
c.callInitSkuName(func(params *tInitdataInitSkuNameParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = initdata.InitSkuName(params.Ctx, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 初始化vendor category
|
||
// @Description 初始化vendor category
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorID formData int true "厂商ID"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /InitVendorCategory [post]
|
||
func (c *InitDataController) InitVendorCategory() {
|
||
c.callInitVendorCategory(func(params *tInitdataInitVendorCategoryParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = initdata.InitVendorCategory(params.Ctx, params.VendorID, params.IsAsync)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 将资源上传到平台(当前为饿百与美团)
|
||
// @Description 将资源上传到平台(当前为饿百与美团)
|
||
// @Param token header string true "认证token"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /UploadImage4Vendors [post]
|
||
func (c *InitDataController) UploadImage4Vendors() {
|
||
c.callUploadImage4Vendors(func(params *tInitdataUploadImage4VendorsParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = initdata.UploadImg4Vendors(params.Ctx, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 从饿百店建商品
|
||
// @Description 从饿百店建商品
|
||
// @Param token header string true "认证token"
|
||
// @Param baiduShopID formData int true "skuNameID"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /BuildSkuFromEbaiStore [post]
|
||
func (c *InitDataController) BuildSkuFromEbaiStore() {
|
||
c.callBuildSkuFromEbaiStore(func(params *tInitdataBuildSkuFromEbaiStoreParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = initdata.BuildSkuFromEbaiStore(params.Ctx, int64(params.BaiduShopID), params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|