From 7118f75c841fe105202b5336d894bfc0ed0dd17f Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期四, 21 十一月 2019 14:58:12 +0800
Subject: [PATCH] 车牌换车辆

---
 cache/cache.go |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/cache/cache.go b/cache/cache.go
index 608b9f4..2706eb1 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -144,11 +144,10 @@
 	if flag {
 		var dicss map[string][]Dic
 		b, _ := json.Marshal(dics)
-		if err := json.Unmarshal(b, &dicss) ; err == nil {
+		if err := json.Unmarshal(b, &dicss); err == nil {
 			for key, dics1 := range dicss {
-				for _,dic := range dics1 {
-					logger.Debug("瀛楀吀缂撳瓨鍒濆鍖�",PREFIX_DIC+key+dic.value, dic)
-					cMap.Set(PREFIX_DIC+key+dic.value, dic)
+				for _, dic := range dics1 {
+					cMap.Set(PREFIX_DIC + key + dic.Value, dic)
 				}
 			}
 		}
@@ -228,16 +227,16 @@
 		return sdk, errors.New("sdk not found")
 	}
 }
+
 // 鑾峰彇瀛楀吀鍊�
-func GetDic(key string) (value string) {
-	obj, b := cMap.Get(PREFIX_SDK + key)
+func GetDic(key string) (name string) {
+	obj, b := cMap.Get(PREFIX_DIC + key)
 	if b {
-		return obj.(Dic).value
+		return obj.(Dic).Name
 	} else {
 		return ""
 	}
 }
-
 
 func initSoData() {
 	var api dbapi.SoApi
@@ -259,11 +258,11 @@
 }
 
 type Dic struct {
-	Id          string
-	value       string
-	Name        string
-	Type        string
-	Description string
-	Sort        int
-	Parent_id   string
+	Id          string `json:"id"`
+	Value       string `json:"value"`
+	Name        string `json:"name"`
+	Type        string `json:"type"`
+	Description string `json:"description"`
+	Sort        int    `json:"sort"`
+	Parent_id   string `json:"parent_id"`
 }

--
Gitblit v1.8.0