From f64dd9f191dff341b4eb430d7bacc44a3db9a279 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期五, 04 三月 2022 10:12:45 +0800 Subject: [PATCH] fix nil --- routers/router.go | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/routers/router.go b/routers/router.go index b25ea35..4cdf460 100644 --- a/routers/router.go +++ b/routers/router.go @@ -9,9 +9,10 @@ import ( "car-service/controllers" - "github.com/astaxie/beego/plugins/cors" - + "car-service/extend/util" + "fmt" "github.com/astaxie/beego" + "github.com/astaxie/beego/plugins/cors" ) func init() { @@ -39,6 +40,9 @@ //) //beego.AddNamespace(ns) //beego.Router("/basic/api/car/app/user", &controllers.UserController{}) + rootPath := util.GetAppRootPath() + fmt.Println("rootPath:", rootPath) + beego.SetStaticPath("/download", rootPath+"/download") preApi := "/basic/api" beego.Router(preApi+"/car/statistic", &controllers.CarController{}, "*:Statistic") beego.Router(preApi+"/car/spaceNo", &controllers.CarController{}, "*:SpaceNo") @@ -49,4 +53,16 @@ beego.Router(preApi+"/user/logout", &controllers.UserController{}, "*:Logout") beego.Router(preApi+"/user/addPlateNo", &controllers.UserController{}, "*:AddPlateNo") beego.Router(preApi+"/user/myPlateNos", &controllers.UserController{}, "*:MyPlateNos") + beego.Router(preApi+"/user/delPlateNo", &controllers.UserController{}, "*:DelPlateNo") + + beego.Router(preApi+"/user/all", &controllers.UserController{}, "*:GetUserAll") + beego.Router(preApi+"/user/sync", &controllers.UserController{}, "*:Sync") + + beego.Router(preApi+"/car/crossRecord", &controllers.CarController{}, "*:CrossRecord") + beego.Router(preApi+"/car/testPush", &controllers.CarController{}, "*:TestPush") + + beego.Router(preApi+"/car/testNightPush", &controllers.CarController{}, "*:TestNightPush") + beego.Router(preApi+"/car/pushLog", &controllers.CarController{}, "*:PushLog") + beego.Router(preApi+"/car/spaceInfo", &controllers.CarController{}, "*:SpaceInfo") + beego.Router(preApi+"/car/spaceUser", &controllers.CarController{}, "*:SpaceUser") } -- Gitblit v1.8.0