common.go 336 B

1234567891011
  1. package v1
  2. type PaginatedResponse[T any] struct {
  3. Records []T `json:"records"`
  4. // 元数据 (Metadata)
  5. Total int64 `json:"total"` // 总记录数
  6. Page int `json:"page"` // 当前页码
  7. PageSize int `json:"pageSize"` // 每页条数
  8. TotalPages int `json:"totalPages"` // 总页数 (方便前端计算)
  9. }