From d2279f4dba80efef9a08641e633b11b66430c2aa Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 22 八月 2019 17:59:12 +0800
Subject: [PATCH] Merge branch 'master' of ssh://192.168.1.14:29418/dbapi

---
 dicApi.go |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/dicApi.go b/dicApi.go
index ddff79b..0a2e455 100644
--- a/dicApi.go
+++ b/dicApi.go
@@ -1 +1,44 @@
 package dbapi
+
+import (
+	"encoding/json"
+	"fmt"
+)
+
+type DicApi struct {
+
+}
+
+func (api DicApi) FindByType(dicType string) (bool,interface{}) {
+	url := BASIC_URL + DATA_URL_PREFIX + "/dictionary/findByType"
+	client := NewClient()
+	paramMap := make(map[string]string)
+	paramMap["type"] = dicType
+	respBody, err := client.DoGetRequest(url, paramMap, nil)
+	if err !=nil {
+		return false,nil
+	}
+	var res Result
+	if err = json.Unmarshal(respBody, &res); err != nil {
+		fmt.Println(err)
+		return false,nil
+	}
+	return res.Success,res.Data
+}
+
+func (api DicApi) FindByParentId(parentId string) (bool,interface{}){
+	url := BASIC_URL + DATA_URL_PREFIX + "/dictionary/findByParentId"
+	client := NewClient()
+	paramMap := make(map[string]string)
+	paramMap["parentId"] = parentId
+	respBody, err := client.DoGetRequest(url, paramMap, nil)
+	if err !=nil {
+		return false,nil
+	}
+	var res Result
+	if err = json.Unmarshal(respBody, &res); err != nil {
+		fmt.Println(err)
+		return false,nil
+	}
+	return res.Success,res.Data
+}
\ No newline at end of file

--
Gitblit v1.8.0