user

package
v0.0.0-...-e3494e8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPostDB            = "user.gorm.db"
	KeyPostNoCheckRouter = "user.router.nocheck"
	KeyPostCheckRouter   = "user.router.check"
)
View Source
const (
	SqlQueryUserByID = `SELECT * 
						FROM users 
						WHERE id = ? AND deleted_at IS NULL`
)

Variables

View Source
var Dao = new(UserDao)

Functions

func Bind

func Bind(c *fiber.Ctx, user *model.User) error

func Exit

func Exit(c *fiber.Ctx) error

Exit 退出登录

func ExitWx

func ExitWx(c *fiber.Ctx) error

ExitWx 退出微信登录

func GetCurrentUser

func GetCurrentUser(c *fiber.Ctx) error

GetCurrentUser 获取当前用户信息

func GetUser

func GetUser(c *fiber.Ctx) error

GetUser 获取用户信息

func Login

func Login(c *fiber.Ctx) error

Login 登录

func Register

func Register(c *fiber.Ctx) error

Register 注册

func Update

func Update(c *fiber.Ctx) error

Update 更新用户数据

Types

type UserDao

type UserDao struct {
}

func (UserDao) ExistsByID

func (us UserDao) ExistsByID(uid uint) error

ExistsByID 用户是否存在

func (UserDao) GetByID

func (us UserDao) GetByID(uid uint) (*model.User, error)

GetByID get the user by id

func (UserDao) Login

func (us UserDao) Login(username, password string) error

Login login

func (UserDao) LoginJWT

func (us UserDao) LoginJWT(username, token string) error

LoginJWT 登录

func (UserDao) Register

func (us UserDao) Register(username, password, ip string) (error, uint)

Register register

func (UserDao) Update

func (us UserDao) Update(user *body.User) error

Update 更新用户信息

Jump to

Keyboard shortcuts

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