liuxiaolong
2019-07-02 0bac6b67e85e00b785b6ab527e0cbc8bad04638c
router/router.go
@@ -7,6 +7,7 @@
   "github.com/szuecs/gin-glog"
   "time"
   "webserver/controllers"
   "webserver/middlewares/auth"
   _ "webserver/docs"
)
@@ -15,7 +16,7 @@
   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))
@@ -37,11 +38,21 @@
   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)
   }
   //区域管理
@@ -60,12 +71,12 @@
      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)
@@ -199,7 +210,6 @@
   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)