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
{"regions":{"Banff Yoho Kootenay":{"display":"Banff, Yoho and Kootenay National Parks","url":"http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=1","type":"parks"},"Glacier":{"display":"Glacier National Park","url":"http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=3","type":"parks"},"Chic-Chocs":{"display":"Haute Gaspésie","url":"http://www.centreavalanche.qc.ca/conditions/bulletins-avalanche/bulletin-fr","type":"web"},"Jasper":{"display":"Jasper National Park","url":"http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=2","type":"parks"},"Kananaskis Country":{"display":"Kananaskis","url":"http://www.avalanche.ca/dataservices/cac/bulletins/xml/Kananaskis","type":"cac"},"Kootenay Boundary":{"display":"Kootenay Boundary","url":"http://www.avalanche.ca/dataservices/cac/bulletins/xml/Kootenay-Boundary","type":"cac"},"Lizard Range":{"display":"Lizard Range","url":"http://www.avalanche.ca/dataservices/cac/bulletins/xml/Lizardrange","type":"cac"},"North Columbia - Monashees and Selkirks":{"display":"North Columbia |
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
Routes -> GET /v1/reports/:reportId v1.Controller.ListReturn(action = GetReportById(reportId:Long)) | |
trait DbAction[T] { | |
def query(): DBIOAction[T, NoStream, Nothing] | |
} | |
case class GetReportById(id: Report.Id)(implicit reports: TableQuery[ReportsTable]) extends DbAction[Seq[Report]] { | |
override def query(): DBIOAction[Seq[Report], NoStream, Effect.Read] = { | |
val query = reports //.filter(reportFilter) |
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
Routes -> GET /v1/reports/:reportId v1.ProductController.List(reportId:Long) | |
class ProductsController() extends Controller | |
def list(@ApiParam(value = "Id of the Report", required = true) id: Report.Id) | |
= Action.async { | |
MapResponse(DAO.run(reports.filter(id == id))) | |
} | |
} |
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
object Language { | |
def unapply(arg: Language): Option[String] = Some(toString(arg)) | |
def apply(str: String): Language = fromString(str) | |
val err = (k: String, e: Exception) => s"Cannot parse $k as ${this.getClass.getName()}: ${e.getMessage}" | |
def toString(l:Language) = l.toString.toLowerCase | |
def fromString(s: String):Language = s.toLowerCase match { | |
case "french" => French() | |
case "english" => English() |