| | |
| | | models.SetSpaceNo(hikSta.TotalPermPlace) |
| | | initCacheM = true |
| | | } |
| | | if left <=10 && left != prePushLeft { |
| | | if left <=5 && left != prePushLeft { |
| | | go func() { |
| | | message := fmt.Sprintf("%s 剩余车位:%d个", time.Now().Format("2006-01-02 15:04:05"), left) |
| | | b, e := service.Push("育英智慧停车", message) |
| | |
| | | // @Failure 403 {string} json "" |
| | | // @router /spaceNo [get] |
| | | func (c *CarController) SpaceNo() { |
| | | userId := c.GetString("userId") |
| | | sv := service.NewCarService() |
| | | spaceNos := sv.FindSpaceNo() |
| | | spaceNos := sv.FindSpaceNo(userId) |
| | | sort.Sort(spaceNos) |
| | | resp := code.Code{ |
| | | Success: true, |
| | |
| | | func (c *CarController) BindCarSpace() { |
| | | |
| | | c.ServeJSON() |
| | | } |
| | | |
| | | // @router /crossRecord [get] |
| | | func (c *CarController) CrossRecord() { |
| | | sv := service.NewCarService() |
| | | records := sv.CrossRecords() |
| | | resp := code.Code{ |
| | | Success: true, |
| | | Status: http.StatusOK, |
| | | Data: records, |
| | | } |
| | | c.Data["json"] = resp |
| | | c.ServeJSON() |
| | | } |