user.go 669 B

1234567891011121314151617181920212223
  1. package routers
  2. import (
  3. "Ic_ouath/app/controller"
  4. middleware "Ic_ouath/app/middlewares"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func UserRouter(r *gin.Engine) {
  8. group := r.Group("/api")
  9. group.POST("/user", controller.PhoneRegist)
  10. group.POST("/sendcode", controller.SendCode)
  11. group.POST("/login", controller.Login)
  12. group.POST("/codelogin", controller.CodeLogin)
  13. group.POST("/updatepassword", controller.UpdatePassword)
  14. adminGroup := r.Group("/api/admin")
  15. adminGroup.Use(middleware.Authentication())
  16. adminGroup.POST("/getalluser", controller.GetUserAlls)
  17. adminGroup.POST("/user", controller.UpdateUserById)
  18. adminGroup.DELETE("/user", controller.DeleteUserById)
  19. }