2019-10-07 08:14:47 -06:00
|
|
|
// Copyright (c) Mainflux
|
2018-08-26 13:15:48 +02:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-08-06 17:06:55 +02:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/mainflux/mainflux"
|
2019-11-05 11:57:16 +01:00
|
|
|
"github.com/mainflux/mainflux/transformers/senml"
|
2018-08-06 17:06:55 +02:00
|
|
|
)
|
|
|
|
|
2019-04-25 00:18:43 +02:00
|
|
|
var _ mainflux.Response = (*pageRes)(nil)
|
2018-08-06 17:06:55 +02:00
|
|
|
|
2019-04-25 00:18:43 +02:00
|
|
|
type pageRes struct {
|
2019-11-05 11:57:16 +01:00
|
|
|
Total uint64 `json:"total"`
|
|
|
|
Offset uint64 `json:"offset"`
|
|
|
|
Limit uint64 `json:"limit"`
|
|
|
|
Messages []senml.Message `json:"messages"`
|
2018-08-06 17:06:55 +02:00
|
|
|
}
|
|
|
|
|
2019-04-25 00:18:43 +02:00
|
|
|
func (res pageRes) Headers() map[string]string {
|
2018-08-06 17:06:55 +02:00
|
|
|
return map[string]string{}
|
|
|
|
}
|
|
|
|
|
2019-04-25 00:18:43 +02:00
|
|
|
func (res pageRes) Code() int {
|
2018-08-06 17:06:55 +02:00
|
|
|
return http.StatusOK
|
|
|
|
}
|
|
|
|
|
2019-04-25 00:18:43 +02:00
|
|
|
func (res pageRes) Empty() bool {
|
2018-08-06 17:06:55 +02:00
|
|
|
return false
|
|
|
|
}
|