liuxiaolong
2020-08-12 7b820a98601ba59fd06eda83983f2fdc6fd47fd8
controllers/car.go
@@ -42,7 +42,7 @@
               if left <=lowerLimit && left != prePushLeft {
                  go func() {
                     message := fmt.Sprintf("%s 剩余车位:%d个", time.Now().Format("2006-01-02 15:04:05"), left)
                     b, e := service.PushByAlias("育英智慧停车", message)
                     b, e := service.PushByAlias("育英中学停车", message)
                     prePushLeft = left
@@ -53,7 +53,7 @@
            }
            //判断当前是否在22:00-22:30之间
            now := time.Now()
            if now.Hour() == 21 && now.Minute()>=0 && now.Minute() <=29{
            if now.Hour() == 22 && now.Minute()>=0 && now.Minute() <=30{
               if now.Minute() == 0 {
                  if nightPushTimes ==0 {
                     go nightPush()
@@ -69,7 +69,7 @@
                     go nightPush()
                     nightPushTimes++
                  }
               } else if now.Minute() == 29 {
               } else if now.Minute() == 30 {
                  if nightPushTimes == 3{
                     go nightPush()
                     nightPushTimes++
@@ -88,7 +88,7 @@
func nightPush(){
   message := fmt.Sprintf("%s 请尽快驶出停车场", time.Now().Format("2006-01-02 15:04:05"))
   b, e := service.NightPush("育英智慧停车", message)
   b, e := service.NightPush("育英中学停车", message)
   fmt.Println("b:", b,"e:",e, "message:", message)