Skip to content

Commit

Permalink
Added parameter sortBy
Browse files Browse the repository at this point in the history
  • Loading branch information
ylyangtw committed Jan 17, 2024
1 parent fbcd1d9 commit ddbb69a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ public TypeController(
@Operation(summary = "list all types belong user has access to.")
public Response listTypes(
@Parameter(name = "Name of the space.") @DefaultValue("") @QueryParam("space") String spaceName,
@Parameter(name = "Specify the field or attribute on which the sorting is to be performed.") @DefaultValue("name") @QueryParam("sortBy") String sortBy,
@Parameter(name = "Specify the order of sorting, either ascending or descending.") @DefaultValue("asc") @QueryParam("order") String order,
@Parameter(name = "Skip the first n results.") @DefaultValue("0") @QueryParam("skip") int offset,
@Parameter(name = "Limit number of results to return.") @DefaultValue("50") @QueryParam("limit") int limit,
@Parameter(name = "List the hyperlinks.") @DefaultValue("false") @QueryParam("hyperlink") boolean hyperlink,
@Parameter(name = "Return the full response.") @DefaultValue("false") @QueryParam("detail") boolean detail) {

// import type comparator
Comparator<Type> comparator = typeComparator("name", order);
Comparator<Type> comparator = typeComparator(sortBy, order);

List<Type> typeList = this.typeDAO.getTypes();

Expand Down

0 comments on commit ddbb69a

Please sign in to comment.