fixed code documentation

This commit is contained in:
Fran Jurmanović
2021-08-29 10:51:29 +02:00
parent 0682252859
commit f441f46494
35 changed files with 674 additions and 70 deletions

View File

@@ -13,7 +13,16 @@ type AuthController struct {
UsersService *services.UsersService
}
// Initializes AuthController.
/*
NewAuthController
Initializes AuthController.
Args:
*services.UsersService: Users service
*gin.RouterGroup: Gin Router Group
Returns:
*AuthController: Controller for "auth" interactions
*/
func NewAuthController(rs *services.UsersService, s *gin.RouterGroup) *AuthController {
rc := new(AuthController)
rc.UsersService = rs
@@ -26,6 +35,11 @@ func NewAuthController(rs *services.UsersService, s *gin.RouterGroup) *AuthContr
return rc
}
/*
PostLogin
Args:
*gin.Context: Gin Application Context
*/
// ROUTE (POST /auth/login).
func (rc *AuthController) PostLogin(c *gin.Context) {
body := new(models.Login)
@@ -42,6 +56,11 @@ func (rc *AuthController) PostLogin(c *gin.Context) {
}
}
/*
PostRegister
Args:
*gin.Context: Gin Application Context
*/
// ROUTE (POST /auth/register).
func (rc *AuthController) PostRegister(c *gin.Context) {
body := new(models.User)
@@ -60,6 +79,11 @@ func (rc *AuthController) PostRegister(c *gin.Context) {
}
}
/*
Delete
Args:
*gin.Context: Gin Application Context
*/
// ROUTE (DELETE /auth/deactivate).
func (rc *AuthController) Delete(c *gin.Context) {
auth := new(models.Auth)
@@ -75,6 +99,11 @@ func (rc *AuthController) Delete(c *gin.Context) {
}
}
/*
CheckToken
Args:
*gin.Context: Gin Application Context
*/
// ROUTE (GET /auth/check-token).
func (rc *AuthController) CheckToken(c *gin.Context) {
token, _ := c.GetQuery("token")