return questiontype as string
This commit is contained in:
parent
f16ff49215
commit
8e83ed89fa
@ -280,7 +280,7 @@ WHERE privilege_name = $2
|
|||||||
|
|
||||||
-- name: GetAllAnswersByQuizID :many
|
-- name: GetAllAnswersByQuizID :many
|
||||||
SELECT DISTINCT ON (a.question_id)
|
SELECT DISTINCT ON (a.question_id)
|
||||||
a.content, a.created_at, a.question_id, a.id, q.questiontype, quiz.qid
|
a.content, a.created_at, a.question_id, a.id, q.questiontype::Text as questiontype, quiz.qid
|
||||||
FROM
|
FROM
|
||||||
answer a
|
answer a
|
||||||
JOIN
|
JOIN
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.26.0
|
// sqlc v1.25.0
|
||||||
|
|
||||||
package sqlcgen
|
package sqlcgen
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.26.0
|
// sqlc v1.25.0
|
||||||
|
|
||||||
package sqlcgen
|
package sqlcgen
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.26.0
|
// sqlc v1.25.0
|
||||||
// source: queries.sql
|
// source: queries.sql
|
||||||
|
|
||||||
package sqlcgen
|
package sqlcgen
|
||||||
@ -805,7 +805,7 @@ func (q *Queries) GetAccountWithPrivileges(ctx context.Context, userID sql.NullS
|
|||||||
|
|
||||||
const getAllAnswersByQuizID = `-- name: GetAllAnswersByQuizID :many
|
const getAllAnswersByQuizID = `-- name: GetAllAnswersByQuizID :many
|
||||||
SELECT DISTINCT ON (a.question_id)
|
SELECT DISTINCT ON (a.question_id)
|
||||||
a.content, a.created_at, a.question_id, a.id, q.questiontype, quiz.qid
|
a.content, a.created_at, a.question_id, a.id, q.questiontype::Text as questiontype, quiz.qid
|
||||||
FROM
|
FROM
|
||||||
answer a
|
answer a
|
||||||
JOIN
|
JOIN
|
||||||
@ -823,7 +823,7 @@ type GetAllAnswersByQuizIDRow struct {
|
|||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
QuestionID int64 `db:"question_id" json:"question_id"`
|
QuestionID int64 `db:"question_id" json:"question_id"`
|
||||||
ID int64 `db:"id" json:"id"`
|
ID int64 `db:"id" json:"id"`
|
||||||
Questiontype interface{} `db:"questiontype" json:"questiontype"`
|
Questiontype string `db:"questiontype" json:"questiontype"`
|
||||||
Qid uuid.NullUUID `db:"qid" json:"qid"`
|
Qid uuid.NullUUID `db:"qid" json:"qid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ func (r *AnswerRepository) GetAllAnswersByQuizID(ctx context.Context, session st
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, row := range rows {
|
for _, row := range rows {
|
||||||
|
if row.Questiontype == model.TypeFile {
|
||||||
if row.Questiontype.(string) == 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)
|
fileURL, err := r.answerMinio.GetAnswerURL(ctx, row.Qid.UUID.String(), row.QuestionID, row.Content.String)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("GetAnswerURL dal answer minio answer", err)
|
fmt.Println("GetAnswerURL dal answer minio answer", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user