[RJA-1469] [feature] - Project additional methods and links + refactoring #792

Merged
merged 4 commits into from Jan 30, 2013

Projects

None yet

3 participants

Member
rsvato commented Jan 30, 2013

No description provided.

@ddurnev ddurnev commented on the diff Jan 30, 2013
...a/com/griddynamics/genesis/rest/GroupController.scala
@RequestMapping(value = Array("{id}"), method = Array(RequestMethod.GET))
@ResponseBody
- def get(@PathVariable(value = "id") id: Int) =
- groupService.get(id).getOrElse(throw new ResourceNotFoundException("Group [id = %d] was not found".format(id)))
+ def get(@PathVariable(value = "id") id: Int, request: HttpServletRequest) = {
+ val group = find(id)
+ implicit val req = request
+ wrap(group).withLinksToSelf(GET, PUT, DELETE).filtered()
+ }
+
+ private def find(id: Int) = groupService.get(id).getOrElse(throw new ResourceNotFoundException("Group [id = %d] was not found".format(id)))
ddurnev
ddurnev Jan 30, 2013 Contributor

Why not use scala 2.10 string interpolation?

rsvato
rsvato Jan 30, 2013 Member

Guess it :)

@bugzmanov bugzmanov merged commit 53357b0 into griddynamics:fb-remoting Jan 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment