models

package
v0.0.0-...-3b15a80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateQuestionRequest

type CreateQuestionRequest struct {
	Question  string     `json:"question"`
	TestCases []TestCase `json:"testCases"`
	Score     int        `json:"score"`
}

type FetchQuestionRequest

type FetchQuestionRequest struct {
	QuestionID uint `json:"questionID"`
}

type Question

type Question struct {
	gorm.Model
	Question  string     `json:"question"`
	TestCases []TestCase `json:"testCases" gorm:"foreignKey:QuestionID"` // Define foreign key for TestCases
}

type RunRequest

type RunRequest struct {
	Language string `json:"language"`
	Code     string `json:"code"`
	Input    string `json:"input"`
}

type SignInRequest

type SignInRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SignUpRequest

type SignUpRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type TestCase

type TestCase struct {
	gorm.Model
	QuestionID     uint   `json:"-"` // Foreign key to associate with Question
	Input          string `json:"input"`
	ExpectedOutput string `json:"expectedOutput"`
}

type User

type User struct {
	gorm.Model
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL