feat: prototyping possible interaction of database, controllers, services with auth service
This commit is contained in:
@@ -14,6 +14,25 @@ import (
|
||||
// @Produce json
|
||||
// @Router /auth/registrationBegin [post]
|
||||
func RegistrationBegin(c *gin.Context) {
|
||||
|
||||
var request models.RegistrationBeginRequest
|
||||
|
||||
if err := c.ShouldBindJSON(&request); err != nil {
|
||||
c.Status(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
auths := services.NewAuthService()
|
||||
|
||||
result, err := auths.Login(request)
|
||||
|
||||
if err != nil {
|
||||
c.Status(http.StatusTeapot)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusFound, result)
|
||||
|
||||
c.Status(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user