quzuu-api-dev / controller /auth /auth_register_controller.go
lifedebugger's picture
Deploy files from GitHub repository
e762600
raw
history blame contribute delete
765 Bytes
package auth
import (
"github.com/gin-gonic/gin"
"godp.abdanhafidz.com/controller"
"godp.abdanhafidz.com/models"
"godp.abdanhafidz.com/services"
)
func Register(c *gin.Context) {
register := services.RegisterService{}
registerController := controller.Controller[models.RegisterRequest, models.Account, models.Account]{
Service: &register.Service,
}
registerController.RequestJSON(c, func() {
registerController.Service.Constructor.Password = registerController.Request.Password
registerController.Service.Constructor.Email = registerController.Request.Email
registerController.Service.Constructor.Username = registerController.Request.Username
registerController.Service.Constructor.Role = "USER"
register.Create()
})
}