From 88fa351cbb2eaf8b4285625192dd655564b88456 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 27 Sep 2019 09:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86DataResource.IsVendor=E6=94=B9?= =?UTF-8?q?=E4=B8=BAUseType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/initdata/initdata.go | 2 +- business/jxutils/datares/datares.go | 4 ++-- business/model/common.go | 2 +- business/model/dao/common.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/business/jxstore/initdata/initdata.go b/business/jxstore/initdata/initdata.go index c31c387bc..0f4da6137 100644 --- a/business/jxstore/initdata/initdata.go +++ b/business/jxstore/initdata/initdata.go @@ -309,7 +309,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, - resource_type, name, main_url, ebai_url, qiniu_url, is_vendor) + resource_type, name, main_url, ebai_url, qiniu_url, use_type) SELECT t1.created_at, t1.created_at, t1.last_operator, t1.img_hash_code, CASE WHEN INSTR(t1.desc_img, ".jpg") > 0 OR INSTR(t1.desc_img, ".jpeg") > 0 THEN diff --git a/business/jxutils/datares/datares.go b/business/jxutils/datares/datares.go index 6f4534548..d0d87d7be 100644 --- a/business/jxutils/datares/datares.go +++ b/business/jxutils/datares/datares.go @@ -84,7 +84,7 @@ func RegisterDataResource(ctx *jxcontext.Context, name, resourceURL, mimeType, h HashCode: hashCode, ResourceType: mimeType, MainURL: resourceURL, - IsVendor: int8(imgType), + UseType: int8(imgType), } vendorID := jxutils.GuessDataResourceVendor(resourceURL) @@ -179,7 +179,7 @@ func UploadImage2Vendors(ctx *jxcontext.Context, parentTask tasksch.ITask, dataR func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { vendorID := batchItemList[0].(int) if handler := partner.GetPurchasePlatformFromVendorID(vendorID); handler != nil { - imgHint, err2 := handler.UploadImg(ctx, dataRes.MainURL, imgData, imgName, int(dataRes.IsVendor)) + imgHint, err2 := handler.UploadImg(ctx, dataRes.MainURL, imgData, imgName, int(dataRes.UseType)) if err = err2; err == nil { retVal = [][]interface{}{ []interface{}{ diff --git a/business/model/common.go b/business/model/common.go index 16ce08a1e..d9c36a28a 100644 --- a/business/model/common.go +++ b/business/model/common.go @@ -23,7 +23,7 @@ type DataResource struct { ResourceType string `orm:"size(48)" json:"resourceType"` // 资料的mime type Name string `orm:"size(48);index" json:"name"` - IsVendor int8 `json:"isVendor"` // 是否是平台需要的(平台需要才会上传到平台) + UseType int8 `json:"isVendor"` // 图资源使用方式(大于0才可能需要上传至平台) MainURL string `orm:"size(512);column(main_url);unique" json:"mainURL"` QiniuURL string `orm:"size(512);column(qiniu_url);index" json:"qiniuURL"` diff --git a/business/model/dao/common.go b/business/model/dao/common.go index fe36d8662..f3dbab71a 100644 --- a/business/model/dao/common.go +++ b/business/model/dao/common.go @@ -26,7 +26,7 @@ func GetNeedUploadDataResource(db *DaoDB) (dataResList []*model.DataResource, er sql := ` SELECT t1.* FROM data_resource t1 - WHERE t1.is_vendor <> 0 AND (t1.ebai_url = '' OR t1.mtwm_url = '')` + WHERE t1.use_type <> 0 AND (t1.ebai_url = '' OR t1.mtwm_url = '')` err = GetRows(db, &dataResList, sql) return dataResList, err }