aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r--src/server/Model/Json/Message.hs16
-rw-r--r--src/server/Model/Json/Translation.hs18
-rw-r--r--src/server/Model/Json/Translations.hs17
3 files changed, 51 insertions, 0 deletions
diff --git a/src/server/Model/Json/Message.hs b/src/server/Model/Json/Message.hs
new file mode 100644
index 0000000..354dd8f
--- /dev/null
+++ b/src/server/Model/Json/Message.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+module Model.Json.Message
+ ( Message(..)
+ ) where
+
+import Data.Aeson
+import Data.Text (Text)
+import GHC.Generics
+
+data Message = Message
+ { message :: Text
+ } deriving (Show, Generic)
+
+instance FromJSON Message
+instance ToJSON Message
diff --git a/src/server/Model/Json/Translation.hs b/src/server/Model/Json/Translation.hs
new file mode 100644
index 0000000..7291157
--- /dev/null
+++ b/src/server/Model/Json/Translation.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+module Model.Json.Translation
+ ( Translation(..)
+ ) where
+
+import GHC.Generics
+
+import Data.Aeson
+import Data.Text
+
+data Translation = Translation
+ { key :: Text
+ , message :: Text
+ } deriving (Show, Generic)
+
+instance FromJSON Translation
+instance ToJSON Translation
diff --git a/src/server/Model/Json/Translations.hs b/src/server/Model/Json/Translations.hs
new file mode 100644
index 0000000..21b188a
--- /dev/null
+++ b/src/server/Model/Json/Translations.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+module Model.Json.Translations
+ ( Translations(..)
+ ) where
+
+import Data.Aeson
+import GHC.Generics
+
+import Model.Json.Translation
+
+data Translations = Translations
+ { translations :: [Translation]
+ } deriving (Show, Generic)
+
+instance FromJSON Translations
+instance ToJSON Translations