| | |
| | | if now.Hour() == 22 && now.Minute()>=0 && now.Minute() <=30{ |
| | | if now.Minute() == 0 { |
| | | if nightPushTimes ==0 { |
| | | go nightPush() |
| | | go nightPush(nightPushTimes) |
| | | nightPushTimes++ |
| | | } |
| | | } else if now.Minute() == 10 { |
| | | if nightPushTimes == 1 { |
| | | go nightPush() |
| | | go nightPush(nightPushTimes) |
| | | nightPushTimes++ |
| | | } |
| | | } else if now.Minute() == 20 { |
| | | if nightPushTimes == 2{ |
| | | go nightPush() |
| | | go nightPush(nightPushTimes) |
| | | nightPushTimes++ |
| | | } |
| | | } else if now.Minute() == 30 { |
| | | if nightPushTimes == 3{ |
| | | go nightPush() |
| | | go nightPush(nightPushTimes) |
| | | nightPushTimes++ |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | func nightPush(){ |
| | | func nightPush(curTimes int){ |
| | | |
| | | message := fmt.Sprintf("%s 请尽快驶出停车场", time.Now().Format("2006-01-02 15:04:05")) |
| | | b, e, aliasArr,carOwnNames := service.NightPush("育英中学停车", message) |
| | |
| | | logE.Insert() |
| | | fmt.Println("b:", b,"e:",e, "message:", message) |
| | | |
| | | if curTimes == 3 { //只给管理员推送一次这个消息 |
| | | //将具体的车主信息推送给管理员 |
| | | if carOwnNames != nil && len(carOwnNames) >0 { |
| | | //获取车主姓名 |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | var cacheSpaceLeft int |
| | | var cLock sync.RWMutex |
| | | func updateSpaceLeft(num int) { |