Source

atlassian-scala-example-plugin / src / main / scala / com / atlassian / plugins / polyglot / scalaexample / rest / RoomResource.scala

Full commit
package com.atlassian.plugins.polyglot.scalaexample.rest

import javax.ws.rs.core.MediaType
import com.atlassian.plugins.polyglot.scalaexample.hipchat.RoomService
import javax.ws.rs._

import scala.collection.JavaConverters._

@Path("room")
@Consumes(Array(MediaType.APPLICATION_JSON))
@Produces(Array(MediaType.APPLICATION_JSON))
class RoomResource(roomService:RoomService) {

  @GET
  def list = roomService.list.asJava

  @GET
  @Path("{id : \\d+}")
  def roomHistory(@PathParam("id") roomId:Int) = roomService.roomHistory(roomId).asJava
}