From 4c7890a506f95bfc8d06a75dbf6150bb8fcad1bb Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期六, 28 九月 2019 15:28:32 +0800
Subject: [PATCH] add logger

---
 controllers/dbtablesCon.go |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go
index 9436848..7b588a9 100644
--- a/controllers/dbtablesCon.go
+++ b/controllers/dbtablesCon.go
@@ -26,8 +26,8 @@
 // @Produce json
 // @Tags dbtable
 // @Param isSync path string true "鏄惁鍚屾搴�  1 鍚屾搴� 2鏈湴搴�  qita 鍏ㄩ儴搴�"
-// @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁", success:true}"
-// @Failure 500 {string} json "{"code":500,  msg:"杩斿洖閿欒淇℃伅", success:false}"
+// @Success 200 {string} json "{"code":200, msg:"", success:true}"
+// @Failure 500 {string} json "{"code":500,  msg:"", success:false}"
 // @Router /data/api-v/dbtable/queryDbTables/{isSync} [POST]
 func (dbt DbTableController) QueryDbTables(c *gin.Context) {
 	isSync := c.Params.ByName("isSync")
@@ -35,6 +35,29 @@
 	b, data := tApi.QueryDbTables(isSync)
 	if b{
 		util.ResponseFormat(c, code.Success, data)
+	} else {
+		util.ResponseFormat(c,code.ComError,[]interface{}{})
+	}
+}
+
+// @Summary 鏌ヨ鏈満鎵�鏈夊簳搴撳垪琛�
+// @Description 鏌ヨ鏈満鎵�鏈夊簳搴撳垪琛�
+// @Accept  x-www-form-urlencoded
+// @Produce json
+// @Tags dbtable
+// @Param isDelete query string true "0锛氭煡鏈垹闄わ紝1锛氭煡宸插垹闄わ紝鍏朵粬锛氭煡鎵�鏈�"
+// @Success 200 {string} json "{"code":200, msg:"", success:true}"
+// @Failure 500 {string} json "{"code":500, msg:"", success:false}"
+// @Router /data/api-v/dbtable/findAllDbTablesByCurServer [GET]
+func (dbt DbTableController) FindAllDbTablesByCurServer(c *gin.Context) {
+	var api dbapi.DbTableApi
+	isDeleteStr := c.Query("isDelete")
+	if isDeleteStr == "" {
+		isDeleteStr = "0"
+	}
+	arr,e := api.FindAllDbTablesByCurServer(isDeleteStr)
+	if e == nil {
+		util.ResponseFormat(c,code.Success, arr)
 	} else {
 		util.ResponseFormat(c,code.ComError,[]interface{}{})
 	}
@@ -253,12 +276,16 @@
 		} else {
 			dbtable.Enable = 0
 		}
-	} else if st.Before(currentTime) && endTime == "" {
-		dbtable.Enable = 1
 	} else {
-		dbtable.Enable = 0
+		if st.Before(currentTime) {
+			dbtable.Enable = 1
+		} else {
+			dbtable.Enable = 0
+		}
 	}
 
+	logger.Debug("AddDbTableInfo dbtable.Enable:",dbtable.Enable,",startTime:",startTime,",endTime:",endTime,",st:",st,",curTime:",currentTime)
+
 	paramBody := util.Struct2Map(dbtable)
 	var tApi dbapi.DbTableApi
 	b, data := tApi.AddDbTableInfo(paramBody)

--
Gitblit v1.8.0