users

package
v0.0.0-...-a9450b3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(user *models.User) *errors.AppError

创建用户

func DelUserByUserName

func DelUserByUserName(username string) *errors.AppError

通过用户名删除用户

func GetUserByUserName

func GetUserByUserName(username string) (*models.User, *errors.AppError)

通过用户名获取用户信息

func RouteRegister

func RouteRegister(group *gin.RouterGroup)

注册路由

Types

type LoginReq

type LoginReq struct {
	// 用户名
	Username string `json:"username" validate:"required"`
	// 密码
	Password string `json:"password" validate:"required,len=32"`
}

type LoginRst

type LoginRst struct {
	// 登录凭证
	Token string `json:"token" validate:"required"`
	// 用户名
	Username string `json:"username" validate:"required"`
	// 昵称
	Nickname string `json:"nickname"`
}

func LoginService

func LoginService(req LoginReq) (LoginRst, *errors.AppError)

登录

Jump to

Keyboard shortcuts

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