This file contains 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
post("/files") { | |
// HACK Transform all BigInts to Doubles | |
val transformedBody = parsedBody transformField { | |
case (key, JInt(bigInt)) => (key, JDouble(bigInt.toDouble)) | |
} | |
val meta = transformedBody.asInstanceOf[JObject].values.get("meta").get.asInstanceOf[Map[String, Map[String, Any]]] | |
//... | |
/// Store in Database | |
updateFileMetadata(fileOrigin, meta) |
This file contains 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
def createDataSource(name: String): ComboPooledDataSource = { | |
val cpds = new ComboPooledDataSource(name) | |
logger.info(f"Created c3p0 connection pool: $name") | |
cpds | |
} | |
val cpdsMaster = createDataSource("master") | |
val cpdsSlave = createDataSource("slave") |
This file contains 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
import org.scalatra.ScalatraServlet | |
import org.scalatra.json.JacksonJsonSupport | |
import java.util.Date | |
import com.novus.salat.annotations._ | |
import com.novus.salat.dao.SalatDAO | |
import com.novus.salat.global._ | |
import com.novus.salat.grater | |
import com.mongodb.casbah.Imports._ |
NewerOlder