account

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserIsAdmin

func CheckUserIsAdmin(c *gin.Context)

@Tags Account @Summary determine whether you are an administrator @Description to determine whether the current user is an administrator, the header must include the username. @Produce application/json @Success 200 {object} string @Failure 200 {object} string @Router /user/checkIsAdmin [post] CheckUserIsAdmin determine whether you are an administrator

func EditPassword

func EditPassword(c *gin.Context)

@Tags Account @Summary modify account password @Description to modify the current user's password, the username must be included in the header. @Accept application/x-www-form-urlencoded @Produce application/json @Param oldPassword formData string true "old password" @Param newPassword formData string true "new password" @Success 200 {object} string @Failure 200 {object} string @Router /user/password/edit [post] EditPassword modify account password

func GetUserInfo

func GetUserInfo(c *gin.Context)

@Tags Account @Summary get user information @Description return the current user's detailed information. The header must include the username. @Produce application/json @Success 200 {object} string @Failure 200 {object} string @Router /user/getInfo [post] GetUserInfo get user information

func GetUserRole

func GetUserRole(c *gin.Context)

@Tags Account @Summary get user role @Description return the current user's role information. The header must include the username. @Produce application/json @Success 200 {object} string @Failure 200 {object} string @Router /user/getUserRole [post] GetUserRole get user role

func Login

func Login(c *gin.Context)

func Logout

func Logout(c *gin.Context)

@Tags Account @Summary user logout @Description log out the current user (invalidate the token) @Produce application/json @Success 200 {object} string @Router /user/logout [post] Logout user logout

func Register

func Register(c *gin.Context)

@Tags Register @Summary user registration @Produce application/json @Param username formData string true "username" @Param password formData string true "password" @Success 200 {string} string "{"code":"","data":""}" @Router /register [post]

Types

type LoginResult

type LoginResult struct {
	Username string `json:"username"`
	Token    string `json:"token"`
}

login result

Jump to

Keyboard shortcuts

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