From b48281d89363bdc96f3938c6346516be9066e7e0 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 20 Sep 2019 16:57:26 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DGuessDataResourceVendor?= =?UTF-8?q?=E4=B8=AD=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/jxutils.go | 2 +- business/model/food_recipe.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index 4ea6c2da8..10cc665be 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -712,7 +712,7 @@ func GuessDataResourceVendor(resourceURL string) (vendorID int) { vendorID = -1 for tmpVendorID, urlList := range resourceTypeMap { for _, v := range urlList { - if strings.Index(resourceURL, "//"+v) >= 0 { + if v != "" && strings.Index(resourceURL, "//"+v) >= 0 { vendorID = tmpVendorID break } diff --git a/business/model/food_recipe.go b/business/model/food_recipe.go index 6c75cb419..f9f79c203 100644 --- a/business/model/food_recipe.go +++ b/business/model/food_recipe.go @@ -13,7 +13,7 @@ type FoodRecipe struct { AuthorID string `orm:"size(48);column(author_id);index" json:"authorID"` Description string `orm:"size(4096)" json:"description"` - Img string `orm:"size(1024)" json:"img"` + Img string `orm:"size(512)" json:"img"` TimeInMinute int `json:"timeInMinute"` // 大约时间(分钟) UpvoteCount int `json:"upvoteCount"` DownvoteCount int `json:"downvoteCount"` @@ -39,7 +39,7 @@ type FoodRecipeStep struct { Name string `orm:"size(48)" json:"name"` Description string `orm:"size(4096)" json:"description"` - Img string `orm:"size(1024)" json:"img"` + Img string `orm:"size(512)" json:"img"` } func (*FoodRecipeStep) TableUnique() [][]string {