model

package
v1.1.5-0...-3eb88c4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT 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 Student

type Student struct {
	Id         int64           `db:"id"`
	Name       string          `db:"name"`
	Age        sql.NullInt64   `db:"age"`
	Score      sql.NullFloat64 `db:"score"`
	CreateTime time.Time       `db:"create_time"`
	UpdateTime sql.NullTime    `db:"update_time"`
}

type StudentModel

type StudentModel interface {
	Insert(data Student) (sql.Result, error)
	FindOne(id int64) (*Student, error)
	Update(data Student) error
	Delete(id int64) error
}

func NewStudentModel

func NewStudentModel(conn sqlx.SqlConn, c cache.CacheConf) StudentModel

type User

type User struct {
	Id         int64     `db:"id"`
	User       string    `db:"user"`     // 用户
	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 interface {
	Insert(data User) (sql.Result, error)
	FindOne(id int64) (*User, error)
	FindOneByUser(user string) (*User, error)
	FindOneByName(name string) (*User, error)
	FindOneByMobile(mobile string) (*User, error)
	Update(data User) error
	Delete(id int64) error
}

func NewUserModel

func NewUserModel(conn sqlx.SqlConn) UserModel

Jump to

Keyboard shortcuts

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