user_demo_repo

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserDemo added in v1.2.1

type UserDemo struct {
	Id        uint      `gorm:"column:id;primary_key;AUTO_INCREMENT"`                 // 主键
	UserName  string    `gorm:"column:user_name;NOT NULL"`                            // 用户名
	NickName  string    `gorm:"column:nick_name;NOT NULL"`                            // 昵称
	Mobile    string    `gorm:"column:mobile;NOT NULL"`                               // 手机号
	IsDeleted int       `gorm:"column:is_deleted;default:-1;NOT NULL"`                // 是否删除 1:是  -1:否
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP;NOT NULL"` // 创建时间
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;NOT NULL"` // 更新时间
}

用户Demo表

func (*UserDemo) TableName added in v1.2.1

func (m *UserDemo) TableName() string

type UserRepo

type UserRepo interface {
	Create(ctx core.Context, user UserDemo) (id uint, err error)
	UpdateNickNameByID(ctx core.Context, id uint, username string) (err error)
	GetUserByUserName(ctx core.Context, username string) (*UserDemo, error)
	Delete(ctx core.Context, id uint) (err error)
	// contains filtered or unexported methods
}

func NewUserRepo

func NewUserRepo(db db.Repo) UserRepo

Jump to

Keyboard shortcuts

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