repository

package
v0.0.0-...-86911bf Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCESS_TOKEN_PREFIX  = "access:"
	REFRESH_TOKEN_PREFIX = "refresh:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentRepository

type CommentRepository interface {
	List(db *gorm.DB, postID uint, limit int, cursor *time.Time) ([]*entity.Comment, error)
	GetByID(db *gorm.DB, id uint) (*entity.Comment, error)
	Create(db *gorm.DB, e *entity.Comment) (*entity.Comment, error)
	Delete(db *gorm.DB, id uint) error
}

func NewCommentRepository

func NewCommentRepository() CommentRepository

type GroupRepository

type GroupRepository interface {
	ListByUserID(db *gorm.DB, userID uint) ([]*entity.Group, error)
	GetByID(db *gorm.DB, id uint) (*entity.Group, error)
	BelongTo(db *gorm.DB, userID, groupID uint) (bool, error)
	Create(db *gorm.DB, e *entity.Group, userIDs []uint) (*entity.Group, error)
	Update(db *gorm.DB, e *entity.Group) (*entity.Group, error)
	Delete(db *gorm.DB, id uint) error
	AddUsers(db *gorm.DB, groupID uint, userIDs []uint) error
	RemoveUser(db *gorm.DB, groupID, userID uint) error
}

func NewGroupRepository

func NewGroupRepository() GroupRepository

type PostRepository

type PostRepository interface {
	List(db *gorm.DB, user *entity.User, authorID *uint, tagID *uint, filter,
		q, orderBy string, limit int, cursor *time.Time) ([]*entity.Post, error)
	GetByID(db *gorm.DB, id uint) (*entity.Post, error)
	Create(db *gorm.DB, e *entity.Post) (*entity.Post, error)
	Update(db *gorm.DB, e *entity.Post) (*entity.Post, error)
	Delete(db *gorm.DB, id uint) error
	IncrementCommentCount(db *gorm.DB, id uint) error
	DecrementCommentCount(db *gorm.DB, id uint) error
	IncrementPresentCount(db *gorm.DB, id uint) error
	DecrementPresentCount(db *gorm.DB, id uint) error
	UpdateStatus(db *gorm.DB, id uint, status string) error
}

func NewPostRepository

func NewPostRepository() PostRepository

type SessionRepository

type SessionRepository interface {
	SetTokens(userID uint) (*string, *string, error)
	GetUserIDByAccessToken(accessToken string) (uint, error)
	GetUserIDByRefreshToken(refreshToken string) (uint, error)
	DeleteRefreshToken(refreshToken string) error
}

func NewSessionRepository

func NewSessionRepository(redisClient *redis.Client) SessionRepository

type StampRepository

type StampRepository interface {
	Get(db *gorm.DB, userID, postID uint) (*entity.Stamp, error)
	FindByPostID(db *gorm.DB, postID uint) ([]*entity.Stamp, error)
	FindByPostIDs(db *gorm.DB, postIDs []uint) ([]*entity.Stamp, error)
	Create(db *gorm.DB, e *entity.Stamp) (*entity.Stamp, error)
	Delete(db *gorm.DB, userID, postID uint) error
}

func NewStampRepository

func NewStampRepository() StampRepository

type TagRepository

type TagRepository interface {
	List(db *gorm.DB, limit int, offset *int) ([]*entity.Tag, error)
	GetByID(db *gorm.DB, id uint) (*entity.Tag, error)
	FindByIDs(db *gorm.DB, ids []uint) ([]*entity.Tag, error)
	Create(db *gorm.DB, e *entity.Tag) (*entity.Tag, error)
	Update(db *gorm.DB, e *entity.Tag) (*entity.Tag, error)
	Delete(db *gorm.DB, id uint) error
}

func NewTagRepository

func NewTagRepository() TagRepository

type UserRepository

type UserRepository interface {
	List(db *gorm.DB, user *entity.User, q *string, groupID *uint, orderBy string, limit int, cursor *int) ([]*entity.User, error)
	GetByID(db *gorm.DB, id uint) (*entity.User, error)
	FindByIDs(db *gorm.DB, ids []uint) ([]*entity.User, error)
	GetByUserName(db *gorm.DB, userName string) (*entity.User, error)
	GetByEmail(db *gorm.DB, email string) (*entity.User, error)
	Create(db *gorm.DB, e *entity.User) (*entity.User, error)
	Update(db *gorm.DB, e *entity.User) (*entity.User, error)
	IncrementPostCount(db *gorm.DB, id uint) error
	DecrementPostCount(db *gorm.DB, id uint) error
}

func NewUserRepository

func NewUserRepository() UserRepository

type VosRepository

type VosRepository interface {
	UploadImage(ctx echo.Context, key string) (*string, error)
}

func NewVosRepository

func NewVosRepository() VosRepository

Jump to

Keyboard shortcuts

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