diff --git a/dal/dal.go b/dal/dal.go index aa33fab..49c4b2c 100644 --- a/dal/dal.go +++ b/dal/dal.go @@ -137,6 +137,7 @@ type AmoDal struct { queries *sqlcgen.Queries AmoRepo *amo.AmoRepository QuestionRepo *question.QuestionRepository + AnswerRepo *answer.AnswerRepository } func NewAmoDal(ctx context.Context, cred string) (*AmoDal, error) { @@ -164,11 +165,17 @@ func NewAmoDal(ctx context.Context, cred string) (*AmoDal, error) { Pool: pool, }) + answerRepo := answer.NewAnswerRepository(answer.Deps{ + Queries: queries, + Pool: pool, + }) + return &AmoDal{ conn: pool, queries: queries, AmoRepo: amoRepo, QuestionRepo: questionRepo, + AnswerRepo: answerRepo, }, nil } diff --git a/repository/answer/answer.go b/repository/answer/answer.go index e579112..7e9c90c 100644 --- a/repository/answer/answer.go +++ b/repository/answer/answer.go @@ -83,6 +83,7 @@ func (r *AnswerRepository) GetAllAnswersByQuizID(ctx context.Context, session st } for _, row := range rows { + //todo тут забыл добавить проверку на то что minio !=nil /*if row.Questiontype == model.TypeFile { fmt.Println("GALL", row.Qid, row.QuestionID, row.Content) fileURL, err := r.answerMinio.GetAnswerURL(ctx, row.Qid.UUID.String(), row.QuestionID, row.Content.String)