Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions internal/dto/question_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
// QuestionResponseDTO represents the structure to be used
// when returning a question object in an HTTP response.
type QuestionResponseDTO struct {
ID *primitive.ObjectID `json:"id"`
CourseID *uuid.UUID `json:"course_id"`
Title *string `json:"title"`
Description *string `json:"description"`
Tags *[]int `json:"tags"`
AuthorID *uuid.UUID `json:"authorid"`
Votes *int `json:"votes"`
UserVote *int `json:"user_vote"` // 1 for upvote, -1 for downvote, 0 for no vote
CreatedAt *time.Time `json:"created_at"`
Answers *[]AnswerResponseDTO `json:"answers"`
ID *primitive.ObjectID `json:"id"`
CourseID *uuid.UUID `json:"course_id"`
Title *string `json:"title"`
Description *string `json:"description"`
Tags *[]int `json:"tags"`
AuthorID *uuid.UUID `json:"authorid"`
Votes *int `json:"votes"`
UserVote *int `json:"user_vote"` // 1 for upvote, -1 for downvote, 0 for no vote
CreatedAt *time.Time `json:"created_at"`
CorrectAnswer *primitive.ObjectID `json:"correct_answer"` // id of the correct answer
Answers *[]AnswerResponseDTO `json:"answers"`
}