From bae4af47f77a195a12a0437584d667465e826e12 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期一, 17 八月 2020 16:09:28 +0800
Subject: [PATCH] add log

---
 main.go |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/main.go b/main.go
index 202ddc5..1af406e 100644
--- a/main.go
+++ b/main.go
@@ -2,8 +2,11 @@
 
 import (
 	"car-service/controllers"
+	"car-service/models"
 	_ "car-service/routers"
+	"car-service/service"
 	"github.com/astaxie/beego"
+	"github.com/robfig/cron"
 )
 
 func main() {
@@ -11,6 +14,13 @@
 		beego.BConfig.WebConfig.DirectoryIndex = true
 		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
 	}
-	controllers.Schedule()
+	models.InitDb()
+	go controllers.ComputeSpaceLeftRealTime()
+	//姣忓ぉ鍚屾娴峰悍鏁版嵁锛岀湅浜哄憳id鏄惁鏈夊彂鐢熷彉鍖�
+	c := cron.New()
+	c.AddFunc("@daily", func() {
+		service.SyncHikPerson()
+	})
+	c.Start()
 	beego.Run()
 }

--
Gitblit v1.8.0