From 4a2eb6f75b11ccb95e67a6f1c3b7cdf5b2c14d0c Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期三, 03 七月 2019 10:39:00 +0800 Subject: [PATCH] only filter current analyServer es data --- router/router.go | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 43 insertions(+), 6 deletions(-) diff --git a/router/router.go b/router/router.go index 145b718..103fa46 100644 --- a/router/router.go +++ b/router/router.go @@ -7,13 +7,16 @@ "github.com/szuecs/gin-glog" "time" "webserver/controllers" + "webserver/middlewares/auth" + + _ "webserver/docs" ) func NewRouter() *gin.Engine { r := gin.Default() r.Use(ginglog.Logger(3 * time.Second)) - //r.Use(auth.AuthHandler())//auth杩囨护鍣� + r.Use(auth.AuthHandler())//auth杩囨护鍣� r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) @@ -32,11 +35,24 @@ cameraTaskArgsController := new(controllers.CameraTaskArgsController) dicController := new(controllers.DictionaryController) userController := new(controllers.UserController) + eventPushController := new(controllers.EventPushController) + pollConfigController := new(controllers.PollConfigController) + fileController := new(controllers.FileController) + sysMenuController :=new(controllers.SysMenuController) urlPrefix := "/data/api-v" // wp 娣诲姞 璺緞 鍓嶇紑 - userApi := r.Group(urlPrefix + "/user") + sysApi := r.Group(urlPrefix + "/sys") { - userApi.POST("/login", userController.Login) + sysApi.POST("/login",userController.Login) + sysApi.POST("/logout",userController.Logout) + } + sysMenuApi := r.Group("/sysmenus") + { + sysMenuApi.GET("/me",sysMenuController.Me) + } + userApi := r.Group(urlPrefix + "/users") + { + userApi.GET("/current",userController.Current) } //鍖哄煙绠$悊 @@ -55,14 +71,17 @@ camera.PUT("/update", cameraController.CameraUpdate) camera.DELETE("/del/:cid", cameraController.CameraDel) camera.GET("/show/:cid", cameraController.CameraSel) - camera.GET("/queryCameraAndTaskInfo", cameraController.QueryCameraAndTaskInfo) + camera.GET("/updateSnapshotUrl/:cid",cameraController.UpdateSnapshotUrl) camera.POST("/alltask", cameraTaskController.FindTasksByCameraIds) camera.GET("/task/:cameraId", cameraTaskController.CameraTaskAll) - camera.GET("/delTask/:cameraId/:taskId", cameraController.CameraDelTask) + camera.DELETE("/delTask/:cameraId/:taskId", cameraController.CameraDelTask) camera.POST("/saveTask", cameraController.CameraTaskSave) camera.GET("/getRulesByCameraAndTask", cameraTaskArgsController.FindByCameraAndTask) + camera.GET("/getCamerasByRunType", cameraController.GetCamerasByRunType) + camera.POST("/updateRunEnable", cameraController.UpdateRunEnable) + camera.POST("/changeRunType", cameraController.ChangeRunType) } cameraTaskArgsApi := r.Group(urlPrefix + "/cameraTaskArgs") @@ -133,6 +152,8 @@ vdbperson.POST("/deleteDbPersonById/:uuid", dbPersonCont.DeleteDbPerson) vdbperson.POST("/deleteMoreDbPerson", dbPersonCont.DeleteMoreDbPerson) vdbperson.PUT("/addDbPerson", dbPersonCont.AddDbPerson) + + vdbperson.POST("/fileUploadTest", fileController.UploadPersonTest) } // 绯荤粺璁剧疆 鎿嶄綔 @@ -166,13 +187,29 @@ dicApi := r.Group(urlPrefix + "/dictionary") { dicApi.GET("/findByType", dicController.FindByType) + dicApi.GET("/findByParentId", dicController.FindByParentId) + } + eventPushApi := r.Group(urlPrefix + "/eventPush") + { + eventPushApi.POST("/save", eventPushController.Save) + eventPushApi.GET("/findByEventTopic", eventPushController.FindByEventTopic) + eventPushApi.GET("/findAll", eventPushController.FindAll) + eventPushApi.GET("/getById", eventPushController.GetById) + eventPushApi.POST("/changeStatus", eventPushController.ChangeStatus) + eventPushApi.POST("/delete", eventPushController.Delete) + } + pollCApi := r.Group(urlPrefix + "/pollConfig") + { + pollCApi.POST("/savePollPeriod", pollConfigController.SavePollPeriod) + pollCApi.POST("/savePollDelay", pollConfigController.SavePollDelay) + pollCApi.GET("/getPollConfig", pollConfigController.GetPollConfig) + pollCApi.POST("/updateEnable", pollConfigController.UpdateEnable) } // 鏂囦欢 涓婁紶 r.Static("static", "./static") // 闈欐�佹枃浠� //澶栭儴璁块棶swagger.json r.StaticFile("/swagger.json", "./docs/swagger.json") - fileController := new(controllers.FileController) vdbperson.POST("/fileupload", fileController.Fileupload) vdbperson.POST("/moreFileUpload", fileController.MoreFileUpload) r.POST(urlPrefix+"/es/ImageUploadReturnPics", fileController.ImageUploadReturnPics) -- Gitblit v1.8.0