After Finish User Register and Login Service via MVC arch

This commit is contained in:
2025-07-19 23:55:25 +08:00
parent 56c625ee6b
commit edd693200c
12 changed files with 168 additions and 19 deletions

View File

@@ -1,6 +1,10 @@
package router
import "github.com/gin-gonic/gin"
import (
"GinTutorial/controllers"
"github.com/gin-gonic/gin"
)
func SetupRouter() *gin.Engine {
r := gin.Default()
@@ -10,12 +14,8 @@ func SetupRouter() *gin.Engine {
{
auth := v1.Group("/auth")
{
auth.POST("/login", func(context *gin.Context) {
context.JSON(200, gin.H{
"msg": "Login successfully",
})
})
auth.POST("/register")
auth.POST("/login", controllers.Login)
auth.POST("/register", controllers.Register)
}
}
}