init.go 402 B

123456789101112131415161718192021
  1. package route
  2. import (
  3. "youngee_b_api/handler"
  4. "youngee_b_api/middleware"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func InitRoute(r *gin.Engine) {
  8. r.POST("/login", handler.WrapPasswordLoginHandler)
  9. m := r.Group("/youngee/m")
  10. {
  11. m.Use(middleware.LoginAuthMiddleware)
  12. m.POST("/test", func(c *gin.Context) {
  13. c.JSON(200, "ok")
  14. // 注意这里只是debug用的 接口要写成handler形式
  15. })
  16. }
  17. }