From 208f5292e39e83c4a27161a453f54faaafaefe37 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 29 五月 2019 11:51:34 +0800
Subject: [PATCH] fix bug

---
 esutil/EsClient.go |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/esutil/EsClient.go b/esutil/EsClient.go
index 75a678d..934133d 100644
--- a/esutil/EsClient.go
+++ b/esutil/EsClient.go
@@ -104,10 +104,10 @@
 
 			source["videoNum"] = getVideoUrl(source)
 
-			picDateStr, err := time.Parse("2006-01-02 15:04:05", source["picDate"].(string))
-			fmt.Println("picDate: ", picDateStr.Format("2006-01-02 15:04:05"))
+			picDateStr := (source["picDate"].(time.Time)).Format("2006-01-02 15:04:05")
+			fmt.Println("picDate: ", picDateStr)
 			if err == nil {
-				source["picDate"] = picDateStr.Format("2006-01-02 15:04:05")
+				source["picDate"] = picDateStr
 			}
 
 			baseInfo := getSourceBaseInfo(source)
@@ -123,7 +123,6 @@
 }
 
 func getAgeDesc(age interface{})(ageDesc string) {
-	fmt.Println("ageInterface: ", age)
 	if age !=nil {
 		ageInt := age.(float64)
 		if ageInt >0 && ageInt<7 {
@@ -140,7 +139,6 @@
 			ageDesc = ""
 		}
 	}
-	fmt.Println("ageDescription: ", ageDesc)
 	return ageDesc
 }
 
@@ -160,7 +158,7 @@
 	Content string `json:"content"`
 }
 
-func getSourceBaseInfo(source map[string]interface{}) (baseInfoJson string) {
+func getSourceBaseInfo(source map[string]interface{}) []BaseInfo {
 	sdkType := source["sdkType"].(string)
 	baseInfoArr := make([]BaseInfo,0)
 	if sdkType == "浜鸿劯" {
@@ -203,13 +201,12 @@
 		}
 
 		baseInfoArr = append(baseInfoArr, baseInfo)
-		bytes, err := json.Marshal(baseInfoArr)
-		if err !=nil {
-			return ""
-		}
-		return string(bytes)
+		//bytes, err := json.Marshal(baseInfoArr)
+		//if err !=nil {
+		//	return ""
+		//}
 	}
-	return ""
+	return baseInfoArr
 }
 
 func getVideoUrl(source map[string]interface{}) (videoUrl string){

--
Gitblit v1.8.0