This commit is contained in:
Vyacheslav1557 2024-10-10 00:04:37 +05:00
parent d62ae666d5
commit 4cdd751b16
11 changed files with 53 additions and 53 deletions

View file

@ -1,4 +1,4 @@
package services
package usecase
import (
"context"

View file

@ -10,16 +10,16 @@ type LanguageUseCase struct {
languageRepo languages.LanguageRepository
}
func NewLanguageService(
languageStorage LanguageStorage,
) *LanguageService {
return &LanguageService{
languageStorage: languageStorage,
func NewLanguageUseCase(
languageRepo languages.LanguageRepository,
) *LanguageUseCase {
return &LanguageUseCase{
languageRepo: languageRepo,
}
}
func (service *LanguageService) ReadLanguageById(ctx context.Context, id int32) (*models.Language, error) {
func (uc *LanguageUseCase) ReadLanguageById(ctx context.Context, id int32) (*models.Language, error) {
//userId := ctx.Value("user_id").(int32)
panic("access control is not implemented yet")
return service.languageStorage.ReadLanguageById(ctx, id)
return uc.languageRepo.ReadLanguageById(ctx, id)
}