Преглед на файлове

去掉名称里的空格

xyxie преди 1 седмица
родител
ревизия
dd052b6b31
променени са 1 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 7 7
      controllers/exchange_crawler.go

+ 7 - 7
controllers/exchange_crawler.go

@@ -62,9 +62,9 @@ func (this *ExchangeCrawler) RefreshIne() {
 		if p.Rank > 0 && p.Rank < 40 && p.Participantabbr1 != "" {
 			//成交量
 			item.Rank = p.Rank
-			item.DealShortName = p.Participantabbr1
-			item.BuyShortName = p.Participantabbr2
-			item.SoldShortName = p.Participantabbr3
+			item.DealShortName = strings.Trim(p.Participantabbr1, " ")
+			item.BuyShortName = strings.Trim(p.Participantabbr2, " ")
+			item.SoldShortName = strings.Trim(p.Participantabbr3, " ")
 			item.DealName = strings.Replace(fmt.Sprintf("%s", p.Participantabbr1+"_"+p.Instrumentid+"_成交量(手)"), " ", "", -1)
 			item.BuyName = strings.Replace(fmt.Sprintf("%s", p.Participantabbr2+"_"+p.Instrumentid+"_持买单量(手)"), " ", "", -1)
 			item.SoldName = strings.Replace(fmt.Sprintf("%s", p.Participantabbr3+"_"+p.Instrumentid+"_持卖单量(手)"), " ", "", -1)
@@ -114,9 +114,9 @@ func (this *ExchangeCrawler) RefreshIne() {
 		} else if p.Rank == 999 {
 			//Top 20
 			item.Rank = p.Rank
-			item.DealShortName = p.Participantabbr1
-			item.BuyShortName = p.Participantabbr2
-			item.SoldShortName = p.Participantabbr3
+			item.DealShortName = strings.Trim(p.Participantabbr1, " ")
+			item.BuyShortName = strings.Trim(p.Participantabbr2, " ")
+			item.SoldShortName = strings.Trim(p.Participantabbr3, " ")
 			item.DealName = strings.Replace(fmt.Sprintf("%s", "top20_"+p.Instrumentid+"_成交量(手)"), " ", "", -1)
 			item.BuyName = strings.Replace(fmt.Sprintf("%s", "top20_"+p.Instrumentid+"_持买单量(手)"), " ", "", -1)
 			item.SoldName = strings.Replace(fmt.Sprintf("%s", "top20_"+p.Instrumentid+"_持卖单量(手)"), " ", "", -1)
@@ -392,4 +392,4 @@ func IneIndexCodeGenerator(shortName, indexName, Instrumentid, suffix string) st
 		}
 	}
 	return strings.Replace(ineIndexCode, " ", "", -1)
-}
+}