services

package
v0.0.0-...-3888536 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(
	logger *zap.Logger,
	globalRepository *repositories.GlobalRepository,
) *Service

func (*Service) CreateArtist

func (svc *Service) CreateArtist(artist *models.Artist) (err error)

func (*Service) DeleteArtist

func (svc *Service) DeleteArtist(id uint) (err error)

func (*Service) GenerateToken

func (svc *Service) GenerateToken(user *models.User) (tokenString string, err error)

func (*Service) GetArtist

func (svc *Service) GetArtist(id uint) (artist *models.Artist, err error)

func (*Service) LoginUser

func (svc *Service) LoginUser(email, password string) (user *models.User, err error)

LoginUser checks if the user exists and if the password is correct If the user exists and the password is correct, it returns the user, otherwise it returns an error

func (*Service) RegisterUser

func (svc *Service) RegisterUser(registerUser *dto.RegisterUser) (user *models.User, err error)

RegisterUser creates a new user in the database

type ServiceInterface

type ServiceInterface interface {
	/* User */
	RegisterUser(registerUser *dto.RegisterUser) (user *models.User, err error)
	LoginUser(email, password string) (user *models.User, err error)

	/* Token */
	GenerateToken(user *models.User) (tokenString string, err error)

	/* Artist */
	CreateArtist(artist *models.Artist) (err error)
	GetArtist(id uint) (artist *models.Artist, err error)
	DeleteArtist(id uint) (err error)
}

TODO: Can we find a way to split this object into different object to avoid having 1000+ methods on the same space

Jump to

Keyboard shortcuts

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