暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types.go 957B

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