refactor(user,session): refactor api

This commit is contained in:
Vyacheslav1557 2025-03-28 20:33:10 +05:00
parent b960a923d2
commit f89e89faae
9 changed files with 74 additions and 76 deletions

View file

@ -1,13 +0,0 @@
package models
//type Language struct {
// Name string
// CompileCmd []string //source: src;result:executable
// RunCmd []string //source: executable
//}
//
//var Languages = []Language{
// {Name: "gcc std=c90",
// CompileCmd: []string{"gcc", "src", "-std=c90", "-o", "executable"},
// RunCmd: []string{"executable"}},
//}

View file

@ -1,26 +0,0 @@
package models
//type Result int32
//
//const (
// NotTested Result = 1 // change only with schema change
// Accepted Result = 2
// WrongAnswer Result = 3
// PresentationError Result = 4
// CompilationError Result = 5
// MemoryLimitExceeded Result = 6
// TimeLimitExceeded Result = 7
// RuntimeError Result = 8
// SystemFailDuringTesting Result = 9
// Testing Result = 10
//)
//
//var ErrBadResult = errors.New("bad result")
//
//func (result Result) Valid() error {
// switch result {
// case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceeded, CompilationError, SystemFailDuringTesting:
// return nil
// }
// return ErrBadResult
//}

View file

@ -48,3 +48,40 @@ type SolutionsFilter struct {
State *int32
Order *int32
}
//type Result int32
//
//const (
// NotTested Result = 1 // change only with schema change
// Accepted Result = 2
// WrongAnswer Result = 3
// PresentationError Result = 4
// CompilationError Result = 5
// MemoryLimitExceeded Result = 6
// TimeLimitExceeded Result = 7
// RuntimeError Result = 8
// SystemFailDuringTesting Result = 9
// Testing Result = 10
//)
//
//var ErrBadResult = errors.New("bad result")
//
//func (result Result) Valid() error {
// switch result {
// case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceeded, CompilationError, SystemFailDuringTesting:
// return nil
// }
// return ErrBadResult
//}
//
//type Language struct {
// Name string
// CompileCmd []string //source: src;result:executable
// RunCmd []string //source: executable
//}
//
//var Languages = []Language{
// {Name: "gcc std=c90",
// CompileCmd: []string{"gcc", "src", "-std=c90", "-o", "executable"},
// RunCmd: []string{"executable"}},
//}

View file

@ -22,7 +22,7 @@ type Task struct {
UpdatedAt time.Time `db:"updated_at"`
}
type RichTask struct {
type TasksListItem struct {
Id int32 `db:"id"`
ProblemId int32 `db:"problem_id"`
ContestId int32 `db:"contest_id"`