model

package
v0.0.0-...-e65f22a Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type User

type User struct {
	Id         int64     `db:"id"`
	Name       string    `db:"name"`     // 用户名称
	Password   string    `db:"password"` // 用户密码
	Mobile     string    `db:"mobile"`   // 手机号
	Gender     string    `db:"gender"`   // 男|女|未公开
	Nickname   string    `db:"nickname"` // 用户昵称
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

type UserModel

type UserModel struct {
	sqlc.CachedConn
	// contains filtered or unexported fields
}

func NewUserModel

func NewUserModel(conn sqlx.SqlConn, c cache.CacheConf) *UserModel

func (*UserModel) Delete

func (m *UserModel) Delete(id int64) error

func (*UserModel) FindOne

func (m *UserModel) FindOne(id int64) (*User, error)

func (*UserModel) FindOneByMobile

func (m *UserModel) FindOneByMobile(mobile string) (*User, error)

func (*UserModel) FindOneByName

func (m *UserModel) FindOneByName(name string) (*User, error)

func (*UserModel) Insert

func (m *UserModel) Insert(data User) (sql.Result, error)

func (*UserModel) Update

func (m *UserModel) Update(data User) error

Jump to

Keyboard shortcuts

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