mock

package
v0.0.0-...-e6cce5a Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockUserRepository

type MockUserRepository interface {
	MockUser() error
}

func NewMockUserRepository

func NewMockUserRepository(db *gorm.DB, l *zap.Logger, ce *casbin.Enforcer) MockUserRepository

type Profile

type Profile struct {
	ID       int64  `gorm:"primaryKey;autoIncrement"`
	UserID   int64  `gorm:"not null;index"`
	RealName string `gorm:"size:50"`
	Avatar   string `gorm:"type:text"`
	About    string `gorm:"type:text"`
	Birthday string `gorm:"column:birthday;type:varchar(10)"`
}

Profile 用户资料信息模型

type User

type User struct {
	ID           int64  `gorm:"primarykey"`                          // 用户ID,主键
	CreateTime   int64  `gorm:"column:created_at;type:bigint"`       // 创建时间,Unix时间戳
	UpdatedTime  int64  `gorm:"column:updated_at;type:bigint"`       // 更新时间,Unix时间戳
	DeletedTime  int64  `gorm:"column:deleted_at;type:bigint;index"` // 删除时间,Unix时间戳,用于软删除
	Username     string `gorm:"type:varchar(100);uniqueIndex"`
	PasswordHash string `gorm:"not null"` // 密码哈希值,不能为空
}

User 用户信息结构体

Jump to

Keyboard shortcuts

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