From 467880f0ce1dd1778b5e9bc92631f970b6b3aa98 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期一, 07 九月 2020 10:49:51 +0800
Subject: [PATCH] add testNightPush

---
 controllers/car.go |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/controllers/car.go b/controllers/car.go
index 22aeaa6..9f50298 100644
--- a/controllers/car.go
+++ b/controllers/car.go
@@ -243,6 +243,30 @@
 	c.ServeJSON()
 }
 
+// @router /testNightPush [get]
+func (c *CarController) TestNightPush() {
+	carOwnNames := service.GetLeftCarOwners()
+
+	//灏嗗叿浣撶殑杞︿富淇℃伅鎺ㄩ�佺粰绠$悊鍛�
+	if carOwnNames != nil && len(carOwnNames) >0 {
+		//鑾峰彇杞︿富濮撳悕
+		managerMsg := fmt.Sprintf("%s 鏈┒绂昏溅涓�: %s", time.Now().Format("2006-01-02 15:04:05"), strings.Join(carOwnNames, " "))
+		mb,me, managerArr := service.Push2Manager("鑲茶嫳涓鍋滆溅", managerMsg)
+		mLogE := models.Log{
+			Id: uuid.NewV4().String(),
+			CreateTime: time.Now().Format("2006-01-02 15:04:05"),
+			Result: mb,
+			Phones: strings.Join(managerArr, ","),
+		}
+		if me != nil {
+			mLogE.Content = me.Error()
+		} else {
+			mLogE.Content = managerMsg
+		}
+		mLogE.Insert()
+		fmt.Println("mb:", mb, "me:", me, "message:", managerMsg)
+	}
+}
 // @router /spaceInfo [get]
 func (c *CarController) SpaceInfo() {
 	sv := service.NewCarService()

--
Gitblit v1.8.0