user

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *gin.Context, in *CreateRequest)

Create 创建用户

func Delete

func Delete(c *gin.Context, in *DeleteRequest)

Delete 删除用户

func EditPassword

func EditPassword(c *gin.Context, in *EditPasswordRequest)

EditPassword 修改密码

func List

func List(c *gin.Context, in *ListRequest)

List 用户列表

func Login

func Login(c *gin.Context, in *LoginRequest)

Login 用户登录

func RefreshToken

func RefreshToken(c *gin.Context, in *RefreshTokenRequest)

RefreshToken 刷新 token

func Update

func Update(c *gin.Context, in *UpdateRequest)

Update 编辑用户

Types

type CreateRequest

type CreateRequest struct {
	Username string `json:"username" binding:"required"` // 用户名,必填
	Password string `json:"password" binding:"required"` // 密码,必填
	RoleID   string `json:"role_id"`                     // 角色UUID
}

type DeleteRequest

type DeleteRequest struct {
	Uuid []string `json:"uuid" binding:"required"` // 用户唯一标识
}

type EditPasswordRequest

type EditPasswordRequest struct {
	OldPassword string `json:"old_password" binding:"required"` // 老密码
	NewPassword string `json:"new_password" binding:"required"` // 新密码
}

type ListReply

type ListReply struct {
	*models.UserBasic
}

type ListRequest added in v1.2.0

type ListRequest struct {
	Keyword string `json:"keyword"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"` // 用户名
	Password string `json:"password"` // 密码
}

type LoginResponse

type LoginResponse struct {
	Token        string   `json:"token"`         // token
	RefreshToken string   `json:"refresh_token"` // 用于延期的 token
	Username     string   `json:"username"`      // 用户名
	Level        string   `json:"level"`         // 用户等级, root:超级管理员
	RoleID       string   `json:"role_id"`       // 角色UUID
	RoleName     string   `json:"role_name"`     // 角色名称
	Permissions  []string `json:"permissions"`   // 权限列表
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `json:"refresh_token" binding:"required"` // 用于延期的 token
}

type UpdateRequest

type UpdateRequest struct {
	Uuid string `json:"uuid" binding:"required"` // 用户uuid,必填
	*CreateRequest
}

Jump to

Keyboard shortcuts

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