From a59ac5c33120c53fabbe52900a7a99d78c059405 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期一, 21 九月 2020 20:09:09 +0800
Subject: [PATCH] app add save and del

---
 client.go |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/client.go b/client.go
index fc23c07..d3539b0 100644
--- a/client.go
+++ b/client.go
@@ -1,5 +1,10 @@
 package dbapi
 
+import (
+	"fmt"
+	"strconv"
+)
+
 type Client interface {
 	//GET
 	DoGetRequest(url string, params map[string]string, headers map[string]string) ([]byte, error)
@@ -11,10 +16,28 @@
 	DoDeleteRequest(url string, contentType string, body map[string]interface{}, headers map[string]string) ([]byte, error)
 }
 
+var BASIC_URL            = "http://127.0.0.1:8001"
+
+var DEFAULT_IP			 = "127.0.0.1"
+var DEFAULT_PORT         = 8001
+
 const (
-	BASIC_URL            = "http://192.168.1.115:8000"
 	DATA_URL_PREFIX      = "/data/api-v"
 	CONTENT_TYPE_FORM    = "application/x-www-form-urlencoded"
 	CONTENT_TYPE_MULFORM = "multipart/form-data"
 	CONTENT_TYPE_JSON    = "application/json"
 )
+
+var logPrint = func(i ...interface{}) {
+	fmt.Println(i)
+}
+//鍒濆鍖杁bserver鐨勫湴鍧�鍜岀鍙�
+func Init(ip string,port int){
+	BASIC_URL = "http://"+ ip + ":" + strconv.Itoa(port)
+}
+
+func InitLog(fn func(i ...interface{})) {
+	if fn != nil {
+		logPrint = fn
+	}
+}
\ No newline at end of file

--
Gitblit v1.8.0