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

26 lines
597 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
}
2024-10-09 19:04:37 +00:00
func NewLanguageUseCase(
languageRepo languages.LanguageRepository,
) *LanguageUseCase {
return &LanguageUseCase{
languageRepo: languageRepo,
2024-08-18 18:03:24 +00:00
}
}
2024-10-09 19:04:37 +00:00
func (uc *LanguageUseCase) 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")
2024-10-09 19:04:37 +00:00
return uc.languageRepo.ReadLanguageById(ctx, id)
2024-08-18 18:03:24 +00:00
}