|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+package types
|
|
|
2
|
+
|
|
|
3
|
+import (
|
|
|
4
|
+ "time"
|
|
|
5
|
+)
|
|
|
6
|
+
|
|
|
7
|
+// QueryRequest 查询请求
|
|
|
8
|
+type QueryRequest struct {
|
|
|
9
|
+ SQL string `json:"sql"`
|
|
|
10
|
+ Params map[string]interface{} `json:"params,omitempty"`
|
|
|
11
|
+}
|
|
|
12
|
+
|
|
|
13
|
+// QueryResult 查询结果
|
|
|
14
|
+type QueryResult struct {
|
|
|
15
|
+ Success bool `json:"success"`
|
|
|
16
|
+ Data interface{} `json:"data,omitempty"`
|
|
|
17
|
+ Error string `json:"error,omitempty"`
|
|
|
18
|
+ Count int `json:"count,omitempty"`
|
|
|
19
|
+ Time string `json:"time,omitempty"`
|
|
|
20
|
+}
|
|
|
21
|
+
|
|
|
22
|
+// PageResult 分页结果
|
|
|
23
|
+type PageResult struct {
|
|
|
24
|
+ QueryResult
|
|
|
25
|
+ Page int `json:"page"`
|
|
|
26
|
+ PageSize int `json:"pageSize"`
|
|
|
27
|
+ Total int `json:"total"`
|
|
|
28
|
+}
|
|
|
29
|
+
|
|
|
30
|
+// HealthCheck 健康检查
|
|
|
31
|
+type HealthCheck struct {
|
|
|
32
|
+ Status string `json:"status"`
|
|
|
33
|
+ Timestamp time.Time `json:"timestamp"`
|
|
|
34
|
+ Version string `json:"version"`
|
|
|
35
|
+}
|