You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.8 KiB
Go
40 lines
1.8 KiB
Go
package http
|
|
|
|
import domain "knowfoolery/backend/services/question-bank-service/internal/domain/question"
|
|
|
|
// RandomQuestionRequest is the POST /questions/random request payload.
|
|
type RandomQuestionRequest struct {
|
|
ExcludeQuestionIDs []string `json:"exclude_question_ids"`
|
|
Theme string `json:"theme"`
|
|
Difficulty domain.Difficulty `json:"difficulty"`
|
|
}
|
|
|
|
// CreateQuestionRequest is the admin create question payload.
|
|
type CreateQuestionRequest struct {
|
|
Theme string `json:"theme" validate:"required,min=2,max=100"`
|
|
Text string `json:"text" validate:"required,min=5,max=1000"`
|
|
Answer string `json:"answer" validate:"required,min=1,max=500"`
|
|
Hint string `json:"hint" validate:"omitempty,max=500"`
|
|
Difficulty domain.Difficulty `json:"difficulty" validate:"required,oneof=easy medium hard"`
|
|
}
|
|
|
|
// UpdateQuestionRequest is the admin update question payload.
|
|
type UpdateQuestionRequest struct {
|
|
Theme string `json:"theme" validate:"required,min=2,max=100"`
|
|
Text string `json:"text" validate:"required,min=5,max=1000"`
|
|
Answer string `json:"answer" validate:"required,min=1,max=500"`
|
|
Hint string `json:"hint" validate:"omitempty,max=500"`
|
|
Difficulty domain.Difficulty `json:"difficulty" validate:"required,oneof=easy medium hard"`
|
|
IsActive bool `json:"is_active"`
|
|
}
|
|
|
|
// BulkImportRequest is the admin bulk import payload.
|
|
type BulkImportRequest struct {
|
|
Questions []CreateQuestionRequest `json:"questions" validate:"required,min=1"`
|
|
}
|
|
|
|
// ValidateAnswerRequest is the POST /questions/:id/validate-answer request payload.
|
|
type ValidateAnswerRequest struct {
|
|
Answer string `json:"answer" validate:"required,min=1,max=500"`
|
|
}
|