설명 없음
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 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  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. WriterHeader bool //如果查询返回cvs格式时候,包含表头还是不包含。true包含。第一行是表头
  11. }
  12. // QueryResult 查询结果
  13. type QueryResult struct {
  14. Success bool `json:"success"`
  15. Data interface{} `json:"data,omitempty"`
  16. Error string `json:"error,omitempty"`
  17. Count int `json:"count,omitempty"`
  18. Time string `json:"time,omitempty"`
  19. }
  20. // PageResult 分页结果
  21. type PageResult struct {
  22. QueryResult
  23. Page int `json:"page"`
  24. PageSize int `json:"pageSize"`
  25. Total int `json:"total"`
  26. }
  27. // HealthCheck 健康检查
  28. type HealthCheck struct {
  29. Status string `json:"status"`
  30. Timestamp time.Time `json:"timestamp"`
  31. Version string `json:"version"`
  32. }