Documentation ¶
Index ¶
- type Service
- func (svc *Service) CreateArtist(artist *models.Artist) (err error)
- func (svc *Service) DeleteArtist(id uint) (err error)
- func (svc *Service) GenerateToken(user *models.User) (tokenString string, err error)
- func (svc *Service) GetArtist(id uint) (artist *models.Artist, err error)
- func (svc *Service) LoginUser(email, password string) (user *models.User, err error)
- func (svc *Service) RegisterUser(registerUser *dto.RegisterUser) (user *models.User, err error)
- type ServiceInterface
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) DeleteArtist ¶
func (*Service) GenerateToken ¶
func (*Service) LoginUser ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.