services

package
v0.0.0-...-e9f4405 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConvertMultipartToFile

func ConvertMultipartToFile(multipartFile *multipart.FileHeader) (*entities.File, error)

func ValidateToken

func ValidateToken(token string) (*entities.Claims, bool)

Types

type AlbumService

type AlbumService struct {
	// contains filtered or unexported fields
}

func NewAlbumService

func NewAlbumService(
	albumRepo repos.AlbumRepo,
) *AlbumService

func (*AlbumService) CreateMany

func (a *AlbumService) CreateMany(ctx context.Context, imageFiles []*multipart.FileHeader) ([]*entities.Image, error)

func (*AlbumService) CreateOne

func (a *AlbumService) CreateOne(ctx context.Context, imageFile *multipart.FileHeader) (*entities.Image, error)

func (*AlbumService) GetUserAlbum

func (a *AlbumService) GetUserAlbum(ctx context.Context) ([]*entities.Image, error)

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(
	userRepo repos.UserRepo,
) *AuthService

func (*AuthService) Login

func (a *AuthService) Login(ctx context.Context, phone string) (*entities.RegisteredUser, error)

func (*AuthService) Register

func (a *AuthService) Register(ctx context.Context, user *entities.User) (*entities.RegisteredUser, error)

type FeedService

type FeedService struct {
	// contains filtered or unexported fields
}

func NewFeedService

func NewFeedService(
	feedRepo repos.FeedRepo,
) *FeedService

func (*FeedService) GetFeed

func (f *FeedService) GetFeed(ctx context.Context, userId int64, page, limit int) ([]*entities.User, error)

type MatchingService

type MatchingService struct {
	// contains filtered or unexported fields
}

func NewMatchingService

func NewMatchingService(
	matchingRepo repos.MatchingRepo,
) *MatchingService

func (*MatchingService) CreateMatching

func (m *MatchingService) CreateMatching(ctx context.Context, matching *entities.UserMatching) (*entities.UserMatching, error)

func (*MatchingService) ListMatching

func (m *MatchingService) ListMatching(ctx context.Context, userId int64, page, limit int) ([]*entities.User, error)

func (*MatchingService) WhoILike

func (m *MatchingService) WhoILike(ctx context.Context, userId int64) ([]*entities.User, error)

func (*MatchingService) WhoLikeMe

func (m *MatchingService) WhoLikeMe(ctx context.Context, partnerId int64) ([]*entities.User, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(
	userRepo repos.UserRepo,
	fileRepo repos.FileRepo,
) *UserService

func (*UserService) CreateUser

func (u *UserService) CreateUser(ctx context.Context, user *entities.User) (*entities.User, error)

func (*UserService) DeleteUser

func (u *UserService) DeleteUser(ctx context.Context, id int64) error

func (*UserService) GetUser

func (u *UserService) GetUser(ctx context.Context, id int64) (*entities.User, error)

func (*UserService) SetAvatar

func (u *UserService) SetAvatar(ctx context.Context, file *multipart.FileHeader) (string, error)

func (*UserService) UpdateUser

func (u *UserService) UpdateUser(ctx context.Context, user *entities.User) (*entities.User, error)

type WalletService

type WalletService struct {
	// contains filtered or unexported fields
}

func NewWalletService

func NewWalletService(
	walletRepo repos.WalletRepo,
) *WalletService

func (*WalletService) CreateTransaction

func (w *WalletService) CreateTransaction(
	ctx context.Context,
	transaction *entities.WalletTransaction,
) (*entities.WalletTransaction, error)

func (*WalletService) GetTotal

func (w *WalletService) GetTotal(
	ctx context.Context,
	userId int64,
) (*decimal.Decimal, error)

func (*WalletService) ListTransactions

func (w *WalletService) ListTransactions(
	ctx context.Context,
	userId int64,
	page, limit int,
) ([]*entities.WalletTransaction, error)

Jump to

Keyboard shortcuts

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