Skip to content

Commit def2bd5

Browse files
committedOct 7, 2022
json schema
1 parent 9ce6476 commit def2bd5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎captcha.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ type Captcha struct {
3535
}
3636

3737
type CaptchaResult struct {
38-
DrawRects []DrawRect
39-
Text string
40-
ImageBase64 string
38+
DrawRects []DrawRect `json:"draw_rect"`
39+
Text string `json:"text"`
40+
ImageBase64 string `json:"image_base64"`
4141
}
4242

4343
func NewCaptcha(width, height int) *Captcha {

‎point.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package captcha
22

33
type Point struct {
4-
X int
5-
Y int
4+
X int `json:"x"`
5+
Y int `json:"y"`
66
}
77

88
type DrawRect struct {
9-
X int
10-
Y int
11-
Width int
12-
Height int
9+
X int `json:"x"`
10+
Y int `json:"y"`
11+
Width int `json:"width"`
12+
Height int `json:"height"`
1313
}
1414

1515
func NewPoint(x int, y int) *Point {

0 commit comments

Comments
 (0)