商品详情描述图片加入DataResource管理,老数据还未迁移

This commit is contained in:
gazebo
2019-09-26 20:55:08 +08:00
parent 998c087d9f
commit 8a1d364e4e
15 changed files with 141 additions and 80 deletions

View File

@@ -166,17 +166,19 @@ func skuStatusJX2Mtwm(status int) int {
return mtwmapi.SellStatusOffline
}
func (p *PurchaseHandler) UploadImg(ctx *jxcontext.Context, imgURL string, imgData []byte, imgName string) (imgHint string, err error) {
func (p *PurchaseHandler) UploadImg(ctx *jxcontext.Context, imgURL string, imgData []byte, imgName string, imgType int) (imgHint string, err error) {
globals.SugarLogger.Debugf("mtwm UploadImg imgURL:%s, imgName:%s", imgURL, imgName)
poiCode4UploadImg := p.getUploadImgPoiCode()
if poiCode4UploadImg == "" {
return "", fmt.Errorf("找不到一个美团门店来上传图片")
}
if globals.EnableMtwmStoreWrite {
if imgData != nil {
imgHint, err = api.MtwmAPI.ImageUpload(poiCode4UploadImg, imgName, imgData)
} else {
imgHint, err = api.MtwmAPI.ImageUploadByURL(poiCode4UploadImg, imgName, imgURL)
if imgType > 0 {
if imgData != nil {
imgHint, err = api.MtwmAPI.ImageUpload(poiCode4UploadImg, imgName, imgData)
} else {
imgHint, err = api.MtwmAPI.ImageUploadByURL(poiCode4UploadImg, imgName, imgURL)
}
}
} else {
imgHint = utils.GetUpperUUID()