liuxiaolong
2020-09-07 467880f0ce1dd1778b5e9bc92631f970b6b3aa98
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()