refactor: simplify API queries

This commit is contained in:
Alexander Zobnin
2020-01-14 17:42:12 +03:00
parent 546ae1893c
commit 7a1743ad41
8 changed files with 295 additions and 288 deletions

View File

@@ -20,8 +20,8 @@ type requestModel struct {
}
type queryRequest struct {
Method string `json:"method,omitempty"`
Params zabbixParams `json:"params,omitempty"`
Method string `json:"method,omitempty"`
Params ZabbixAPIParams `json:"params,omitempty"`
}
type zabbixParamOutput struct {
@@ -60,7 +60,7 @@ func (p *zabbixParamOutput) UnmarshalJSON(data []byte) error {
}
type zabbixParams struct {
type ZabbixAPIParams struct {
Output *zabbixParamOutput `json:"output,omitempty"`
SortField string `json:"sortfield,omitempty"`
SortOrder string `json:"sortorder,omitempty"`