dao

package
v0.0.0-...-7a0ce36 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT = 1 + iota
	ADMIN
)

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(user *User) error

func UpdateUser

func UpdateUser(user *User, fields db.Fields) error

Types

type User

type User struct {
	db.BasicModel
	Username  string `gorm:"type:varchar(24);not null" json:"username"`
	Password  string `gorm:"type:varchar(128);not null" json:"-"`
	Email     string `gorm:"type:varchar(128);not null" json:"email"`
	Role      int32  `gorm:"type:smallint;not null;default:1" json:"role"`
	AvatarFid string `gorm:"column:avatar_fid;type:varchar(64);not null" json:"avatarFid"`
}

func GetUsersByEmail

func GetUsersByEmail(email string) (*User, error)

func GetUsersById

func GetUsersById(id int64) (*User, error)

func (*User) Marshal

func (u *User) Marshal() ([]byte, error)

func (User) TableName

func (User) TableName() string

func (*User) Unmarshal

func (u *User) Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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