liuxiaolong
2020-09-08 50c3437ec2e1874df6468bb83a9d5acf40482e6a
main.go
@@ -1,8 +1,12 @@
package main
import (
   "car-service/controllers"
   "car-service/models"
   _ "car-service/routers"
   "car-service/service"
   "github.com/astaxie/beego"
   "github.com/robfig/cron"
)
func main() {
@@ -10,5 +14,13 @@
      beego.BConfig.WebConfig.DirectoryIndex = true
      beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
   }
   models.InitDb()
   go controllers.ComputeSpaceLeftRealTime()
   //每天同步海康数据,看人员id是否有发生变化
   c := cron.New()
   c.AddFunc("@daily", func() {
      service.SyncHikPerson()
   })
   c.Start()
   beego.Run()
}