Skip to content

Commit

Permalink
fix: changed parameter type for rest params when we use generics to f…
Browse files Browse the repository at this point in the history
…ix jersey warning
  • Loading branch information
angelo.andreussi committed Jun 25, 2024
1 parent c2f4542 commit f88875d
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);

Check warning on line 104 in rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java

View check run for this annotation

Codecov / codecov/patch

rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java#L101-L104

Added lines #L101 - L104 were not covered by tests
}
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 f88875d

Please sign in to comment.