com.linkedin.restli.examples.greetings.server.ScalaGreetingsResource.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of restli-int-test-server Show documentation
Show all versions of restli-int-test-server Show documentation
Pegasus is a framework for building robust, scalable service architectures using dynamic discovery and simple asychronous type-checked REST + JSON APIs.
package com.linkedin.restli.examples.greetings.server
import com.linkedin.restli.server.annotations.{ActionParam, RestLiCollection}
import com.linkedin.restli.examples.greetings.api.Greeting
import com.linkedin.restli.server.resources.CollectionResourceTemplate
import com.linkedin.restli.server.annotations.Action
/**
* A scala rest.li service.
*
* Let's test some scaladoc. First the wiki formats.
*
* Styles: '''bold''', ''italic'', `monospace`, __underline__, ^superscript^, ,,subscript,,
*
* =Header=
*
* ===sub-heading===
*
* [[http://scala-lang.org Scala]]
*
* {{{
* x match {
* case Some(v) => println(v)
* case None => ()
* }
* }}}
*
* - unordered bullet 1
* - unordered bullet 2
*
* 1. ordered bullet 1
* 1. ordered bullet 2
*
* @author Joe Betz
*/
@RestLiCollection(name="scalaGreetings", namespace = "com.linkedin.restli.examples.scala.client")
class ScalaGreetingsResource extends CollectionResourceTemplate[java.lang.Long, Greeting]{
/**
* Now let's test some html formatted scaladoc.
*
* Some html with a link. xab.
*
*
* - unordered bullet 1
* - unordered bullet 2
*
*
* @param id provides the key.
* @return a [[com.linkedin.restli.common.EmptyRecord]]
*/
override def get(id: java.lang.Long) = {
new Greeting().setId(1l).setMessage("Hello, Scala!")
}
/**
* An action.
*
* @param param1 provides a String
* @param param2 provides a Boolean
* @return a string response
*/
@Action(name="action")
def action(@ActionParam(value="param1") param1: String,
@ActionParam(value="param2") param2: java.lang.Boolean,
@ActionParam(value="undocumentedParam") undocumentedParam: java.lang.Boolean): String = {
"Hello"
}
@Action(name="undocumentedAction")
def undocumentedAction(): String = {
"Hello"
}
}
// To make sure we don't accidentally confuse objects and classes, add an object of the same name as the above class
object ScalaGreetingsResource {}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy