/
api.go
78 lines (68 loc) · 1.96 KB
/
api.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package client
type Request struct {
ActiveSourceId string `json:"activeSourceId"`
}
type Package struct {
FieldWidth float32 `json:"fieldWidth"`
FieldLength float32 `json:"fieldLength"`
CenterRadius float32 `json:"centerRadius"`
PenaltyWidth float32 `json:"penaltyWidth`
PenaltyDepth float32 `json:"penaltyDepth`
PenaltyPoint float32 `json:"penaltyPoint"`
BoundaryWidth float32 `json:"boundaryWidth"`
GoalWidth float32 `json:"goalWidth"`
GoalDepth float32 `json:"goalDepth"`
Shapes []Shape `json:"shapes"`
ActiveSourceId string `json:"activeSourceId"`
Sources map[string]string `json:"sources"`
}
type Shape struct {
OrderNumber int32 `json:"orderNumber"`
Line *Line `json:"line,omitempty"`
Circle *Circle `json:"circle,omitempty"`
Rect *Rect `json:"rect,omitempty"`
Text *Text `json:"text,omitempty"`
}
type Point struct {
X float32 `json:"x"`
Y float32 `json:"y"`
}
type Style struct {
Stroke *string `json:"stroke,omitempty"`
StrokeWidth *float32 `json:"strokeWidth,omitempty"`
Fill *string `json:"fill,omitempty"`
FillOpacity *float32 `json:"fillOpacity,omitempty"`
Font *string `json:"font,omitempty"`
}
type Metadata struct {
SourceId string `json:"sourceId,omitempty"`
Layer []string `json:"layer,omitempty"`
VisibleByDefault bool `json:"visibleByDefault,omitempty"`
}
type Line struct {
P1 Point `json:"p1"`
P2 Point `json:"p2"`
Style
Metadata
}
type Rect struct {
X float32 `json:"x"`
Y float32 `json:"y"`
Width float32 `json:"width"`
Height float32 `json:"height"`
Ori float32 `json:"ori"`
Style
Metadata
}
type Circle struct {
Center Point `json:"center"`
Radius float32 `json:"radius"`
Style
Metadata
}
type Text struct {
Text string `json:"text"`
P Point `json:"p"`
Style
Metadata
}