accounts

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAccountFound = errors.New("no account found")

ErrNoAccountFound is returned when no account is found for a given ID.

Functions

func ConfirmEmail added in v0.3.0

func ConfirmEmail(c *gin.Context)

Confirm email address @Summary Confirm email address @Description Confirm email address by providing username and email @Tags Public @Produce json @Success 200 {object} dataset.OkResponse @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /confirmemail [get]

func DeleteAccountByID

func DeleteAccountByID(c *gin.Context)

Delete account by ID @Summary [ADMIN] Delete account by ID @Description Delete account by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Account ID" @Success 200 {object} dataset.OkResponse @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/accounts/{id} [delete]

func ForgotPassword added in v0.3.0

func ForgotPassword(c *gin.Context)

Reset password @Summary Reset password @Description Send a new password to the user's email @Tags Public @Accept json @Produce json @Param input body dataset.ForgotPasswordInput true "Email Address" @Success 200 {object} dataset.OkResponse @Failure 400 {object} dataset.ErrorResponse "Bad Request" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /forgotpassword [post]

func GetAccountByID

func GetAccountByID(c *gin.Context)

Get account by ID @Summary [ADMIN] Get account by ID @Description Get account by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Account ID" @Success 200 {object} dataset.Account @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/accounts/{id} [get]

func GetAccounts

func GetAccounts(c *gin.Context)

Get all accounts @Summary [ADMIN] Get all accounts @Description Get all accounts - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.Account @Failure 500 {object} dataset.ErrorResponse @Router /admin/accounts [get]

func GetMyAccount

func GetMyAccount(c *gin.Context)

Get my account information @Summary Get account info @Description Get information of the currently logged-in user @Security Bearer @Tags Accounts @Produce json @Success 200 {object} dataset.Account "Account Information" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 404 {object} dataset.ErrorResponse "Account not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/myaccount [get]

func Login

func Login(c *gin.Context)

User login @Summary User login @Description Log in a user by providing username and password @Tags Public @Produce json @Param input body dataset.LoginInput true "Credentials Info" @Success 200 {object} dataset.Token @Failure 401 {object} dataset.ErrorResponse @Router /login [post]

func PostAccount

func PostAccount(c *gin.Context)

Create a new account @Summary [ADMIN] Create a new account @Description Create a new account - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param input body dataset.Account true "Account Information" @Success 201 {object} dataset.Account @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/accounts [post]

func PutAccountByID

func PutAccountByID(c *gin.Context)

Update account by ID @Summary [ADMIN] Update account by ID @Description Update account by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Account ID" @Param input body dataset.Account true "Account Information" @Success 200 {object} dataset.Account @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/accounts/{id} [put]

func PutMyAccount

func PutMyAccount(c *gin.Context)

Update my account information @Summary Update account info @Description Update information of the currently logged-in user @Security Bearer @Tags Accounts @Accept json @Produce json @Param input body dataset.Account true "Account Information" @Success 200 {object} dataset.Account @Failure 400 {object} dataset.ErrorResponse @Failure 401 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /v1/myaccount [put]

func PutMyPassword

func PutMyPassword(c *gin.Context)

Update user password @Summary Update password @Description Update the password of the current logged-in user @Security Bearer @Tags Accounts @Accept json @Produce json @Param password body dataset.PasswordUpdateInput true "New Password" @Success 200 {object} dataset.OkResponse "Password updated" @Failure 400 {object} dataset.ErrorResponse "Bad Request" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypassword [put]

func Register

func Register(c *gin.Context)

Register a new user account @Summary Register new user @Description Register a new user with username, password, email, firstname, and lastname @Tags Public @Accept json @Produce json @Param input body dataset.RegisterInput true "Register Informations" @Success 200 {object} dataset.OkResponse @Failure 400 {object} dataset.ErrorResponse @Router /register [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL