domain

package
v0.0.0-...-7c9259c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSessionNotFound = errors.New("not found")
View Source
var ErrUserIsActived = errors.New("已经激活")

Functions

This section is empty.

Types

type AuthRepository

type AuthRepository interface {
	ActivatedAccount(verifyCode string) (user *entity.User, err error)
}

func NewAuthRepository

func NewAuthRepository(db *gorm.DB) AuthRepository

type SessionRepository

type SessionRepository interface {
	Save(s entity.Session, key string) error
	Get(key string) (*entity.Session, error)
	Del(key string) error
}

func NewSessionRepository

func NewSessionRepository(pool *redis.Pool) SessionRepository

type UserRepository

type UserRepository interface {
	Create(user *entity.User) error
	FindByID(id uint) (user *entity.User, err error)
	FindByEmail(email string) (user *entity.User, err error)
}

UserRepository 定义 UserRepository 要实现的接口,提供给service

func NewUserRepository

func NewUserRepository(db *gorm.DB) UserRepository

Jump to

Keyboard shortcuts

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