Skip to content

Instantly share code, notes, and snippets.

@notsoluckycharm
Created July 19, 2011 22:02
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 notsoluckycharm/1093850 to your computer and use it in GitHub Desktop.
Save notsoluckycharm/1093850 to your computer and use it in GitHub Desktop.
/**
* Add a General Comment to the Mongo reporting collection
* Goal: Should be of similar nature to /webapp/../java/../pages/UserReport.java
* Accepts: email
* subject
url
comment
sig
tag
*/
@POST
@Path("/comment")
@Produces(Array("application/json","text/json"))
def addComment(@JContext ui:UriInfo, postParams:MultivaluedMap[String,String] ):Envelope = {
val reportingCollection = Application.reportingCollection();
/* val qp=ui.getQueryParameters();
implicit val srcs:List[MultivaluedMap[String,String]]=List(postParams,qp)
val sendToMongo = MongoDBObject("email" ->getParam("email"),
"subject" -> getParam("subject"),
"comment" -> getParam("comment"),
"sig" -> getParam("sig"),
"tag" -> getParam("tag"))
reportingCollection.save(sendToMongo);*/
Envelope(Created).body(Map("_id" -> ""))
//sendToMongo.get("_id")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment