From 296ec1e167eec3f7951dac60fb88cd92557f2c69 Mon Sep 17 00:00:00 2001 From: 18650180552 Date: Wed, 27 Mar 2019 15:03:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/middle/auth.go | 7 +++++++ main.go | 18 +++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 controller/middle/auth.go diff --git a/controller/middle/auth.go b/controller/middle/auth.go new file mode 100644 index 0000000..1e83857 --- /dev/null +++ b/controller/middle/auth.go @@ -0,0 +1,7 @@ +package middle + +import "github.com/gin-gonic/gin" + +func AuthMiddle(c *gin.Context) { + +} \ No newline at end of file diff --git a/main.go b/main.go index b6e484b..dd76d7e 100644 --- a/main.go +++ b/main.go @@ -70,21 +70,21 @@ func main() { api := r.Group("/api") { /** 添加或修改用户 **/ - api.POST("/api/user", userController.SetUser) + api.POST("/user", userController.SetUser) /** 删除用户 **/ - api.DELETE("/api/user", userController.DelUser) + api.DELETE("/user", userController.DelUser) /** 获取单独用户详情信息 methods(id) **/ - api.GET("/api/user", userController.GetUser) + api.GET("/user", userController.GetUser) /** 获取所有用户 **/ - api.GET("/api/users", userController.Users) - api.POST("/api/search_users", userController.SerarchUsers) + api.GET("/users", userController.Users) + api.POST("/search_users", userController.SerarchUsers) /** 用户登录 **/ - api.POST("/api/login", userController.Login) + api.POST("/login", userController.Login) /** 用户注册 **/ - api.POST("/api/register", userController.Register) + api.POST("/register", userController.Register) /** 用户退出登陆 **/ - api.GET("/api/logout", userController.Logout) - api.POST("/api/verify", mailContoller.OnSendEmailCode) + api.GET("/logout", userController.Logout) + api.POST("/verify", mailContoller.OnSendEmailCode) } e := r.Run(":" + strconv.Itoa(config.GetPort())) if nil != e {