ms-tester/internal/languages/usecase/usecase.go

26 lines
606 B
Go
Raw Normal View History

2024-10-09 18:55:16 +00:00
package usecase
2024-08-18 18:03:24 +00:00
import (
"context"
2024-10-05 16:05:29 +00:00
"git.sch9.ru/new_gate/models"
2024-10-09 18:55:16 +00:00
"git.sch9.ru/new_gate/ms-tester/internal/languages"
2024-08-18 18:03:24 +00:00
)
2024-10-09 18:55:16 +00:00
type LanguageUseCase struct {
languageRepo languages.LanguageRepository
2024-08-18 18:03:24 +00:00
}
func NewLanguageService(
languageStorage LanguageStorage,
) *LanguageService {
return &LanguageService{
languageStorage: languageStorage,
}
}
2024-08-25 16:20:14 +00:00
func (service *LanguageService) ReadLanguageById(ctx context.Context, id int32) (*models.Language, error) {
2024-08-20 22:54:46 +00:00
//userId := ctx.Value("user_id").(int32)
2024-08-18 18:03:24 +00:00
panic("access control is not implemented yet")
return service.languageStorage.ReadLanguageById(ctx, id)
}