update amorepo init

This commit is contained in:
Pavel 2024-05-04 15:35:52 +03:00
parent 38cdac154b
commit f1d3073dc9
2 changed files with 8 additions and 0 deletions

@ -137,6 +137,7 @@ type AmoDal struct {
queries *sqlcgen.Queries queries *sqlcgen.Queries
AmoRepo *amo.AmoRepository AmoRepo *amo.AmoRepository
QuestionRepo *question.QuestionRepository QuestionRepo *question.QuestionRepository
AnswerRepo *answer.AnswerRepository
} }
func NewAmoDal(ctx context.Context, cred string) (*AmoDal, error) { func NewAmoDal(ctx context.Context, cred string) (*AmoDal, error) {
@ -164,11 +165,17 @@ func NewAmoDal(ctx context.Context, cred string) (*AmoDal, error) {
Pool: pool, Pool: pool,
}) })
answerRepo := answer.NewAnswerRepository(answer.Deps{
Queries: queries,
Pool: pool,
})
return &AmoDal{ return &AmoDal{
conn: pool, conn: pool,
queries: queries, queries: queries,
AmoRepo: amoRepo, AmoRepo: amoRepo,
QuestionRepo: questionRepo, QuestionRepo: questionRepo,
AnswerRepo: answerRepo,
}, nil }, nil
} }

@ -83,6 +83,7 @@ func (r *AnswerRepository) GetAllAnswersByQuizID(ctx context.Context, session st
} }
for _, row := range rows { for _, row := range rows {
//todo тут забыл добавить проверку на то что minio !=nil
/*if row.Questiontype == model.TypeFile { /*if row.Questiontype == model.TypeFile {
fmt.Println("GALL", row.Qid, row.QuestionID, row.Content) fmt.Println("GALL", row.Qid, row.QuestionID, row.Content)
fileURL, err := r.answerMinio.GetAnswerURL(ctx, row.Qid.UUID.String(), row.QuestionID, row.Content.String) fileURL, err := r.answerMinio.GetAnswerURL(ctx, row.Qid.UUID.String(), row.QuestionID, row.Content.String)