-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct.go
43 lines (36 loc) · 1.16 KB
/
struct.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// common data struct
package data
import "github.com/si9ma/KillOJ-common/model"
type GroupInviteData struct {
ID string `json:"id"`
GroupID int `json:"group_id"`
Password string `json:"password,omitempty" binding:"max=30"`
Timeout int `json:"timeout" binding:"required,min=3600,max=2592000"` // second , max = 30 day,min = a hour
}
type ContestInviteData struct {
ID string `json:"id"`
ContestID int `json:"contest_id"`
Password string `json:"password,omitempty" binding:"max=30"`
AllowGroups []int `json:"allow_groups"`
}
type GroupWrap struct {
model.Group
NeedPassword bool `json:"need_password"`
Password string `json:"-"`
}
type ContestWrap struct {
model.Contest
NeedPassword bool `json:"need_password"`
Password string `json:"-"`
}
type SubmitArg struct {
ProblemID int
SourceCode string `json:"source_code" binding:"required"`
Language int `json:"language" binding:"exists,oneof=0 1 2 3"`
}
type CommentArg struct {
ProblemID int
Content string `json:"content" binding:"required"`
ForComment int `json:"for_comment" binding:"exists,min=0"`
ToID int `json:"to_id" binding:"exists,min=0"`
}