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表
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 ¶
Click to show internal directories.
Click to hide internal directories.