-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.go
53 lines (43 loc) · 1.12 KB
/
schema.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
package schema
// HTTPStatusText 定义HTTP状态文本
type HTTPStatusText string
func (t HTTPStatusText) String() string {
return string(t)
}
// 定义HTTP状态文本常量
const (
OKStatusText HTTPStatusText = "OK"
)
// HTTPError HTTP响应错误
type HTTPError struct {
Error HTTPErrorItem `json:"error"` // 错误项
}
// HTTPErrorItem HTTP响应错误项
type HTTPErrorItem struct {
Code int `json:"code"` // 错误码
Message string `json:"message"` // 错误信息
}
// HTTPStatus HTTP响应状态
type HTTPStatus struct {
Status string `json:"status"` // 状态(OK)
}
// HTTPList HTTP响应列表数据
type HTTPList struct {
List interface{} `json:"list"`
Pagination *HTTPPagination `json:"pagination,omitempty"`
}
// HTTPPagination HTTP分页数据
type HTTPPagination struct {
Total int `json:"total"`
Current int `json:"current"`
PageSize int `json:"pageSize"`
}
// PaginationParam 分页查询条件
type PaginationParam struct {
PageIndex int // 页索引
PageSize int // 页大小
}
// PaginationResult 分页查询结果
type PaginationResult struct {
Total int // 总数据条数
}