Skip to content

Commit

Permalink
Merge pull request #4063 from Agnul97/fix-jersey_unmarshalling_rest
Browse files Browse the repository at this point in the history
fix: MetricType unmarshalling in APIs
  • Loading branch information
Coduz authored Jun 25, 2024
2 parents 1835162 + f88875d commit 2349705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public <V extends Comparable<V>> MessageListResult simpleQuery(@PathParam("scope
@QueryParam("startDate") DateParam startDateParam,
@QueryParam("endDate") DateParam endDateParam,
@QueryParam("metricName") String metricName,
@QueryParam("metricType") MetricType<V> metricType,
@QueryParam("metricType") String metricType,
@QueryParam("metricMin") String metricMinValue,
@QueryParam("metricMax") String metricMaxValue,
@QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir,
@QueryParam("offset") @DefaultValue("0") int offset,
@QueryParam("limit") @DefaultValue("50") int limit)
throws KapuaException {

MessageQuery query = parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, metricType, metricMinValue, metricMaxValue, sortDir, offset, limit);
MetricType<V> internalMetricType = new MetricType<>(metricType);
MessageQuery query = parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, internalMetricType, metricMinValue, metricMaxValue, sortDir, offset, limit);

return query(scopeId, query);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ public <V extends Comparable<V>> JsonMessageListResult simpleQueryJson(@PathPara
@QueryParam("startDate") DateParam startDateParam,
@QueryParam("endDate") DateParam endDateParam,
@QueryParam("metricName") String metricName,
@QueryParam("metricType") MetricType<V> metricType,
@QueryParam("metricType") String metricType,
@QueryParam("metricMin") String metricMinValue,
@QueryParam("metricMax") String metricMaxValue,
@QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir,
@QueryParam("offset") @DefaultValue("0") int offset,
@QueryParam("limit") @DefaultValue("50") int limit)
throws KapuaException {
MessageQuery query = DataMessages.parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, metricType, metricMinValue, metricMaxValue, sortDir, offset, limit);
MetricType<V> internalMetricType = new MetricType<>(metricType);
MessageQuery query = DataMessages.parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, internalMetricType , metricMinValue, metricMaxValue, sortDir, offset, limit);
query.setScopeId(scopeId);
final MessageListResult result = messageStoreService.query(query);

Expand Down

0 comments on commit 2349705

Please sign in to comment.