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 --- routers/router.go | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/routers/router.go b/routers/router.go index 5a9a84c..fa29e7c 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,8 +40,24 @@ //) //beego.AddNamespace(ns) //beego.Router("/basic/api/car/app/user", &controllers.UserController{}) - beego.Router("/basic/api/car/statistic", &controllers.CarController{}, "*:Statistic") - beego.Router("/basic/api/car/spaceNo", &controllers.CarController{}, "*:SpaceNo") - beego.Router("/basic/api/car/app/version", &controllers.AppController{}, "*:Version") - beego.Router("/basic/api/car/restriction", &controllers.RestrictionController{}, "*:Restriction") + 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") + beego.Router(preApi+"/car/app/version", &controllers.AppController{}, "*:Version") + beego.Router(preApi+"/car/restriction", &controllers.RestrictionController{}, "*:Restriction") + beego.Router(preApi+"/code/new", &controllers.CodeController{}, "*:New") + beego.Router(preApi+"/user/login", &controllers.UserController{}, "*:Login") + 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") } -- Gitblit v1.8.0