Skip to content

Commit 646e105

Browse files
committed
chore: 增添部分json标签
1 parent 2835ed7 commit 646e105

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

api/sentence/v1/sentence_struct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package v1
33
import "github.com/oldme-git/oldme-api/internal/model"
44

55
type List struct {
6-
Id model.Id
6+
Id model.Id `json:"id"`
77
BookId model.Id `json:"book_id"`
88
Sentence string `json:"sentence"`
99
}

api/tag/v1/tag.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
type CreReq struct {
99
g.Meta `path:"tag/create" method:"post" sm:"新增" tags:"标签"`
1010
GrpId model.Id `json:"grpId" v:"required|integer|between:1,4294967295"`
11-
Name string `v:"required|length:1, 30"`
11+
Name string `json:"name" v:"required|length:1, 30"`
1212
}
1313

1414
type CreRes struct {
@@ -18,7 +18,7 @@ type UpdReq struct {
1818
g.Meta `path:"tag/update/{id}" method:"post" sm:"修改" tags:"标签"`
1919
*model.IdInput
2020
GrpId model.Id `json:"grpId" v:"required|integer|between:1,4294967295"`
21-
Name string `v:"required|length:1, 30"`
21+
Name string `json:"name" v:"required|length:1, 30"`
2222
}
2323

2424
type UpdRes struct {

api/tag/v1/tag_struct.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ package v1
33
import "github.com/oldme-git/oldme-api/internal/model"
44

55
type List struct {
6-
Id model.Id
7-
Name string
6+
Id model.Id `json:"id"`
7+
Name string `json:"name"`
88
}

api/tag_grp/v1/tag_grp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
type CreReq struct {
99
g.Meta `path:"tag/group/create" method:"post" sm:"新增" tags:"标签分类"`
10-
Name string `v:"required|length:1, 30"`
10+
Name string `json:"name" v:"required|length:1, 30"`
1111
}
1212

1313
type CreRes struct {
@@ -16,7 +16,7 @@ type CreRes struct {
1616
type UpdReq struct {
1717
g.Meta `path:"tag/group/update/{id}" method:"post" sm:"修改" tags:"标签分类"`
1818
*model.IdInput
19-
Name string `v:"required|length:1, 30"`
19+
Name string `json:"name" v:"required|length:1, 30"`
2020
}
2121

2222
type UpdRes struct {

api/tag_grp/v1/tag_grp_struct.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ package v1
33
import "github.com/oldme-git/oldme-api/internal/model"
44

55
type List struct {
6-
Id model.Id
7-
Name string
6+
Id model.Id `json:"id"`
7+
Name string `json:"name"`
88
}

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
const (
18-
VERSION = "v1.5.0"
18+
VERSION = "v1.5.1"
1919
)
2020

2121
func main() {

0 commit comments

Comments
 (0)