123456789101112131415161718 |
- package routers
- import (
- "bigdata_archives/app/controller"
- middlewares "bigdata_archives/app/middleware"
- "github.com/gin-gonic/gin"
- )
- func UserRouter(r *gin.Engine) {
- group := r.Group("/api")
- group.POST("/login", controller.Login)
- group.GET("/archives", controller.Archives)
- group.POST("/user", controller.AddUser).Use(middlewares.AdminMiddleware())
- group.POST("/userlist", controller.UserList).Use(middlewares.AdminMiddleware())
- group.GET("/getuser", controller.GetUserById).Use(middlewares.AdminMiddleware())
- group.DELETE("/user", controller.DeleteUser).Use(middlewares.AdminMiddleware())
- group.PUT("/user", controller.UpdateUserById).Use(middlewares.AdminMiddleware())
- }
|