mirror of
https://github.com/dreamstarsky/runbin.git
synced 2026-05-15 22:33:09 +00:00
first demo
This commit is contained in:
21
internal/model/Paste.go
Normal file
21
internal/model/Paste.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Paste struct {
|
||||
ID string
|
||||
Code string `json:"code"`
|
||||
Language string `json:"language"`
|
||||
Stdin string `json:"stdin"`
|
||||
Stdout string `json:"stdout"`
|
||||
Stderr string `json:"stderr"`
|
||||
Status PasteStatus `json:"status"`
|
||||
CompileLog string `json:"compile_log"`
|
||||
ExecutionTimeMs int `json:"execution_time_ms"`
|
||||
MemoryUsageKb int `json:"memory_usage_kb"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
BackEnd string `json:"backend"`
|
||||
}
|
||||
14
internal/model/PasteStatus.go
Normal file
14
internal/model/PasteStatus.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
type PasteStatus string
|
||||
|
||||
const (
|
||||
StatusPending PasteStatus = "pending"
|
||||
StatusRunning PasteStatus = "running"
|
||||
StatusCompileError PasteStatus = "compile error"
|
||||
StatusRuntimeError PasteStatus = "runtime error"
|
||||
StatusTimeLimitExceed PasteStatus = "time limit exceeded"
|
||||
StatusMemoryLimitExceed PasteStatus = "memory limit exceeded"
|
||||
StatusUnknownError PasteStatus = "unknown error"
|
||||
StatusCompleted PasteStatus = "completed"
|
||||
)
|
||||
9
internal/model/SubmitRequest.go
Normal file
9
internal/model/SubmitRequest.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
type SubmitRequest struct {
|
||||
Code string `json:"code" binding:"required"`
|
||||
Language string `json:"language" binding:"required"`
|
||||
Run bool `json:"run"`
|
||||
Stdin string `json:"stdin"`
|
||||
BackEnd string `json:"backend"`
|
||||
}
|
||||
Reference in New Issue
Block a user