qdy vor 3 Monaten
Commit
8eec541f41
2 geänderte Dateien mit 38 neuen und 0 gelöschten Zeilen
  1. 3
    0
      go.mod
  2. 35
    0
      response.go

+ 3
- 0
go.mod Datei anzeigen

@@ -0,0 +1,3 @@
1
+module git.x2erp.com/qdy/go-base
2
+
3
+go 1.25.4

+ 35
- 0
response.go Datei anzeigen

@@ -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
+}

Laden…
Abbrechen
Speichern