-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschool.go
More file actions
48 lines (41 loc) · 1.17 KB
/
school.go
File metadata and controls
48 lines (41 loc) · 1.17 KB
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
44
45
46
47
48
package schapi
type SchoolKind int
const (
KinderGarten SchoolKind = 1 + iota
ElementrySchool
MiddleSchool
HighSchool
)
type SchoolRegion string
const (
Seoul SchoolRegion = "stu.sen.go.kr"
Incheon = "stu.ice.go.kr"
Busan = "stu.pen.go.kr"
Gwangju = "stu.gen.go.kr"
Daejeon = "stu.dje.go.kr"
Daegu = "stu.dge.go.kr"
Sejong = "stu.sje.go.kr"
Ulsan = "stu.use.go.kr"
Gyeonggi = "stu.goe.go.kr"
Kangwon = "stu.kew.go.kr"
Chungbuk = "stu.cbe.go.kr"
Chungnam = "stu.cne.go.kr"
Gyeongbuk = "stu.gbe.go.kr"
Gyeongnam = "stu.gne.go.kr"
Jeonbuk = "stu.jbe.go.kr"
Jeonnam = "stu.jne.go.kr"
Jeju = "stu.jje.go.kr"
)
type SchoolCode string
type SchoolAPI struct {
Kind SchoolKind `json:"kind"`
Region SchoolRegion `json:"region"`
Code SchoolCode `json:"code"`
}
func NewSchoolAPI(kind SchoolKind, region SchoolRegion, code SchoolCode) *SchoolAPI {
return &SchoolAPI{
Kind: kind,
Region: region,
Code: code,
}
}