model

package
v0.0.0-...-0872ad6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 10 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"`     // 用户姓名
	Gender     int64     `db:"gender"`   // 用户性别
	Mobile     string    `db:"mobile"`   // 用户电话
	Password   string    `db:"password"` // 用户密码
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

type UserModel

type UserModel interface {
	Insert(ctx context.Context, data *User) (sql.Result, error)
	FindOne(ctx context.Context, id int64) (*User, error)
	FindOneByMobile(ctx context.Context, mobile string) (*User, error)
	Update(ctx context.Context, data *User) error
	Delete(ctx context.Context, id int64) error
}

func NewUserModel

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

Jump to

Keyboard shortcuts

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