Created
July 10, 2013 16:30
-
-
Save solidsnack/5967836 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MOTD { | |
| @JsonProperty | |
| @Length(min=8, max=128, message = "The message mustn't be too short or long.") | |
| var message : String = "Hello World" | |
| } | |
| @Path("motd") | |
| class Endpoint { | |
| @GET @Timed @Produces(Array(MediaType.TEXT_PLAIN)) | |
| def get = Main.get | |
| @POST @Timed @Produces(Array(MediaType.APPLICATION_JSON)) | |
| def set(@Valid motd : MOTD) { | |
| Main.motd = Some(motd.message) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment