From 14961bd9f10eaed19c7504aaa31314fcdf5fcf4f Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 26 Sep 2019 18:06:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20DataResource.ResoureType=E4=B8=BAResource?= =?UTF-8?q?Type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/initdata/initdata.go | 4 ++-- business/jxutils/datares/datares.go | 10 +++++----- business/model/common.go | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/business/jxstore/initdata/initdata.go b/business/jxstore/initdata/initdata.go index e16b9e9e9..89558ea54 100644 --- a/business/jxstore/initdata/initdata.go +++ b/business/jxstore/initdata/initdata.go @@ -314,7 +314,7 @@ func UploadImg4Vendors(ctx *jxcontext.Context, isAsync, isContinueWhenError bool case 1: // 从SkuName添加缺失的图片至DataResource _, err = dao.ExecuteSQL(db, ` INSERT INTO data_resource(created_at, updated_at, last_operator, hash_code, - resoure_type, name, main_url, ebai_url, qiniu_url, is_vendor) + resource_type, name, main_url, ebai_url, qiniu_url, is_vendor) SELECT t1.created_at, t1.created_at, t1.last_operator, t1.img_hash_code, CASE WHEN INSTR(t1.img, ".jpg") > 0 OR INSTR(t1.img, ".jpeg") > 0 THEN @@ -325,7 +325,7 @@ func UploadImg4Vendors(ctx *jxcontext.Context, isAsync, isContinueWhenError bool 'image/gif' ELSE '' - END resoure_type + END resource_type , t1.name, img, img_ebai, IF(INSTR(t1.img, "image.jxc4.com") > 0, t1.img, '') qiniu_url, 1 FROM sku_name t1 JOIN ( diff --git a/business/jxutils/datares/datares.go b/business/jxutils/datares/datares.go index 02e0400b4..1b2f8cd8e 100644 --- a/business/jxutils/datares/datares.go +++ b/business/jxutils/datares/datares.go @@ -81,11 +81,11 @@ func RegisterDataResource(ctx *jxcontext.Context, name, resourceURL, mimeType, h return nil, fmt.Errorf("MIME type:%s非法", mimeType) } dataRes = &model.DataResource{ - Name: name, - HashCode: hashCode, - ResoureType: mimeType, - MainURL: resourceURL, - IsVendor: int8(utils.Bool2Int(isUpload2Vendor)), + Name: name, + HashCode: hashCode, + ResourceType: mimeType, + MainURL: resourceURL, + IsVendor: int8(utils.Bool2Int(isUpload2Vendor)), } vendorID := jxutils.GuessDataResourceVendor(resourceURL) diff --git a/business/model/common.go b/business/model/common.go index c3c26db93..90f2c5b0c 100644 --- a/business/model/common.go +++ b/business/model/common.go @@ -4,7 +4,7 @@ var ( ValidMimeTypes = map[string][]string{ "image/jpeg": []string{"jpeg", "jpg"}, "image/png": []string{"png"}, - "image/gif": []string{"gif"}, + // "image/gif": []string{"gif"}, // 美团不支持GIF "video/mpeg": []string{"mpeg", "mpg"}, "video/mp4": []string{"mp4", "m4v"}, @@ -16,9 +16,9 @@ type DataResource struct { HashCode string `orm:"size(48);unique" json:"hashCode"` - ResoureType string `orm:"size(48)" json:"resoureType"` // 资料的mime type - Name string `orm:"size(48);index" json:"name"` - IsVendor int8 `json:"isVendor"` // 是否是平台需要的(平台需要才会上传到平台) + ResourceType string `orm:"size(48)" json:"resourceType"` // 资料的mime type + Name string `orm:"size(48);index" json:"name"` + IsVendor int8 `json:"isVendor"` // 是否是平台需要的(平台需要才会上传到平台) MainURL string `orm:"size(512);column(main_url);unique" json:"mainURL"` QiniuURL string `orm:"size(512);column(qiniu_url);index" json:"qiniuURL"`