ms-tester/internal/services/language.go
Vyacheslav1557 81e75e5a9c fix:
2024-10-05 21:05:29 +05:00

29 lines
655 B
Go

package services
import (
"context"
"git.sch9.ru/new_gate/models"
)
type LanguageStorage interface {
ReadLanguageById(ctx context.Context, id int32) (*models.Language, error)
}
type LanguageService struct {
languageStorage LanguageStorage
}
func NewLanguageService(
languageStorage LanguageStorage,
) *LanguageService {
return &LanguageService{
languageStorage: languageStorage,
}
}
func (service *LanguageService) 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)
}