Brak opisu
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.

response_model.go 945B

1234567891011121314151617181920212223242526272829
  1. package response
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-base/ctx"
  5. )
  6. // QueryResult 查询结果
  7. type QueryResult[T any] struct {
  8. Success bool `json:"success"`
  9. LastPage int `json:"last_page,omitempty"`
  10. Data T `json:"data,omitempty"`
  11. Error string `json:"error,omitempty"`
  12. Count int `json:"count,omitempty"`
  13. Time string `json:"time,omitempty"`
  14. QueryTime time.Duration `json:"queryTime,omitempty"`
  15. SaveTime time.Duration `json:"saveTime,omitempty"`
  16. TotalCount int `json:"totalCount,omitempty"`
  17. Message string `json:"message,omitempty"`
  18. Metadata *ctx.RequestContext `json:"metadata,omitempty"`
  19. }
  20. // HealthCheck 健康检查
  21. type HealthCheck struct {
  22. Status string `json:"status"`
  23. Timestamp time.Time `json:"timestamp"`
  24. Version string `json:"version"`
  25. }