From e73b432b99ee831a0061b1c53551695b6766800c Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期四, 18 六月 2020 15:21:19 +0800 Subject: [PATCH] test left num --- controllers/car.go | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/controllers/car.go b/controllers/car.go index ab1a353..9dd4fd4 100644 --- a/controllers/car.go +++ b/controllers/car.go @@ -7,6 +7,7 @@ "github.com/astaxie/beego" "net/http" "sort" + "time" ) type CarController struct { @@ -21,8 +22,17 @@ func (c *CarController) Statistic() { //sv := service.NewCarService() //sta := sv.Statistic() + m := time.Now().Minute() + i := m % 10 + left := 80 + if i == 0 { + left = 10 + } + if m == 40 { + left = 5 + } sta := models.CarStatistic{ - Left: 80, + Left: left, } resp := code.Code{ Success: true, -- Gitblit v1.8.0