aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-02 18:37:52 +0700
committerKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-02 18:37:52 +0700
commitd0e3c6f37347142a3ef5eab871dde47ea70af304 (patch)
treea87d24b1b5d6489576f00fe446f05b5110d62cc0 /src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala
parent283ca02360949143ffe7ee8ad87d51902426b450 (diff)
parent1913870abec9e31d080f6858d0fc296445852cc6 (diff)
downloadrest-query-d0e3c6f37347142a3ef5eab871dde47ea70af304.tar.gz
rest-query-d0e3c6f37347142a3ef5eab871dde47ea70af304.tar.bz2
rest-query-d0e3c6f37347142a3ef5eab871dde47ea70af304.zip
Merge branch 'master' into synch-refactor
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala
deleted file mode 100644
index a9d02fc..0000000
--- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/keyword/ApiKeyword.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-package xyz.driver.pdsuidomain.formats.json.keyword
-
-import xyz.driver.pdsuidomain.entities.KeywordWithLabels
-import play.api.libs.functional.syntax._
-import play.api.libs.json.{Format, JsPath}
-import xyz.driver.pdsuidomain.formats.json.label.ApiLabel
-
-final case class ApiKeyword(id: Long, keyword: String, labels: List[ApiLabel])
-
-object ApiKeyword {
-
- implicit val format: Format[ApiKeyword] = (
- (JsPath \ "id").format[Long] and
- (JsPath \ "keyword").format[String] and
- (JsPath \ "labels").format[List[ApiLabel]]
- )(ApiKeyword.apply, unlift(ApiKeyword.unapply))
-
- def fromDomain(keywordWithLabels: KeywordWithLabels) = ApiKeyword(
- id = keywordWithLabels.keyword.id.id,
- keyword = keywordWithLabels.keyword.keyword,
- labels = keywordWithLabels.labels.map(x => ApiLabel(x.id.id, x.name, x.categoryId.id))
- )
-}