feat: move languages to submodule;fix:storage:replace postgres query with array query when getting language

This commit is contained in:
dragonmuffin 2024-08-25 18:13:57 +05:00
parent 02a7a49ac3
commit 75acb422af
5 changed files with 16 additions and 13 deletions

View file

@ -2,11 +2,11 @@ package services
import (
"context"
"git.sch9.ru/new_gate/ms-tester/internal/models"
"git.sch9.ru/new_gate/ms-tester/internal/languages"
)
type LanguageStorage interface {
ReadLanguageById(ctx context.Context, id int32) (*models.Language, error)
ReadLanguageById(ctx context.Context, id int32) (*languages.Language, error)
}
type LanguageService struct {
@ -21,7 +21,7 @@ func NewLanguageService(
}
}
func (service *LanguageService) ReadLanguageById(ctx context.Context, id int32) (*models.Language, error) {
func (service *LanguageService) ReadLanguageById(ctx context.Context, id int32) (*languages.Language, error) {
//userId := ctx.Value("user_id").(int32)
panic("access control is not implemented yet")
return service.languageStorage.ReadLanguageById(ctx, id)