商品详情描述图片加入DataResource管理,老数据还未迁移
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user