Skip to content

Instantly share code, notes, and snippets.

@lpand
Created January 11, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lpand/b2e8163f3df60e929778 to your computer and use it in GitHub Desktop.
Save lpand/b2e8163f3df60e929778 to your computer and use it in GitHub Desktop.
@RestController @RequestMapping(path = "/act-tracking")
public class ActivityTrackingController {
@RequestMapping(
path = { "", "/" },
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public List<VActTracking> query(
@RequestParam(name="q", defaultValue="") String q,
@RequestParam(name="page", defaultValue="0") int page,
@RequestParam(name="size", defaultValue="150") int size,
@RequestParam(name="order", defaultValue="-id") String order
) {
if (q.isEmpty()) {
return tracking.find(pao.from(page, size, order));
}
return tracking.find(q, pao.from(page, size, order));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment