Documentation
¶
Index ¶
- func DeleteAccountByID(c *gin.Context)
- func GetAccountByID(c *gin.Context)
- func GetAccounts(c *gin.Context)
- func GetMyAccount(c *gin.Context)
- func Login(c *gin.Context)
- func PostAccount(c *gin.Context)
- func PutAccountByID(c *gin.Context)
- func PutMyAccount(c *gin.Context)
- func PutMyPassword(c *gin.Context)
- func Register(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAccountByID ¶
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 {string} string "Account deleted" @Failure 400 {object} map[string]interface{} "error" @Failure 500 {object} map[string]interface{} "error" @Router /accounts/{id} [delete]
func GetAccountByID ¶
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} map[string]interface{} "error" @Failure 404 {object} map[string]interface{} "error: Account not found" @Failure 500 {object} map[string]interface{} "error" @Router /accounts/{id} [get]
func GetAccounts ¶
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} map[string]interface{} "error" @Router /accounts [get]
func GetMyAccount ¶
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 400 {object} map[string]interface{} "error" @Failure 404 {object} map[string]interface{} "error: Account not found" @Failure 500 {object} map[string]interface{} "error" @Router /myaccount [get]
func Login ¶
User login @Summary User login @Description Logs in a user by providing username and password @Tags Public @Accept json @Produce json @Param username body string true "Username" @Param password body string true "Password" @Success 200 {object} map[string]string "token" @Failure 403 {object} map[string]interface{} "error: credentials are incorrect or token generation failed" @Router /login [post]
func PostAccount ¶
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} map[string]interface{} "error" @Failure 500 {object} map[string]interface{} "error" @Router /accounts [post]
func PutAccountByID ¶
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} map[string]interface{} "error" @Failure 500 {object} map[string]interface{} "error" @Router /accounts/{id} [put]
func PutMyAccount ¶
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} map[string]interface{} "error" @Failure 500 {object} map[string]interface{} "error" @Router /myaccount [put]
func PutMyPassword ¶
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 string true "Updated Password" @Success 200 {string} string "Updated password successfully" @Failure 400 {object} map[string]interface{} "error" @Failure 500 {object} map[string]interface{} "error" @Router /mypassword [put]
func Register ¶
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 Info" @Success 200 {object} map[string]interface{} "registration success" @Failure 400 {object} map[string]interface{} "error" @Router /register [post]
Types ¶
This section is empty.