📝 Create missing models for API documentation

This commit is contained in:
2024-01-18 00:09:26 +01:00
parent e0190f4bb5
commit 607682884c
6 changed files with 68 additions and 49 deletions

View File

@ -11,17 +11,18 @@ import (
"github.com/gin-gonic/gin"
)
// LoginHandler godoc
// LoginHandler godoc
//
// @Summary User login
// @Description Authenticate user and return JWT token
// @Tags Authentication
// @Accept json
// @Produce json
// @Param loginCredentials body models.LoginCredentials true "Login Credentials"
// @Success 200 {object} map[string]string "Successfully authenticated, JWT token returned"
// @Failure 400 {object} map[string]string "Invalid request body"
// @Failure 401 {object} map[string]string "Invalid login credentials"
// @Failure 500 {object} map[string]string "Internal server error"
// @Success 200 {object} models.TokenResponse "Successfully authenticated, JWT token returned"
// @Failure 400 {object} models.ErrorResponse "Invalid request body"
// @Failure 401 {object} models.ErrorResponse "Invalid login credentials"
// @Failure 500 {object} models.ErrorResponse "Internal server error"
// @Router /login [post]
func LoginHandler(c *gin.Context) {
var creds models.LoginCredentials