From 9db2c42f4880362cf098358de830415c14f6878c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 25 Dec 2015 17:56:13 +0000 Subject: Cleaned tree for rewrite --- servant/api/Thermoprint/Api.hs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 servant/api/Thermoprint/Api.hs (limited to 'servant/api/Thermoprint/Api.hs') diff --git a/servant/api/Thermoprint/Api.hs b/servant/api/Thermoprint/Api.hs deleted file mode 100644 index f3318c4..0000000 --- a/servant/api/Thermoprint/Api.hs +++ /dev/null @@ -1,35 +0,0 @@ -{-# LANGUAGE DataKinds, TypeOperators, DeriveGeneric #-} - -module Thermoprint.Api - ( ThermoprintApi - ) where - -import Thermoprint -import Data.Aeson -import Servant.API -import qualified Data.Text.Lazy as Text -import qualified Data.ByteString.Lazy.Char8 as ByteString -import Data.ByteString.Lazy.Char8 (ByteString) -import GHC.Generics - -import Control.Monad - -import Data.Int (Int64) - -instance ToJSON ByteString where - toJSON = toJSON . Text.pack . ByteString.unpack -instance FromJSON ByteString where - parseJSON value = (ByteString.pack . Text.unpack) `liftM` parseJSON value - -instance ToJSON c => ToJSON (Inline c) -instance FromJSON c => FromJSON (Inline c) - -instance ToJSON c => ToJSON (Block c) -instance FromJSON c => FromJSON (Block c) - -type ThermoprintApi = "print" :> Capture "printerId" Integer :> ReqBody '[JSON] (Block String) :> Post '[JSON] () - :<|> "drafts" :> Get '[JSON] [(Int64, String)] - :<|> "drafts" :> ReqBody '[JSON] (String, Block String) :> Put '[JSON] Int64 - :<|> "drafts" :> Capture "draftId" Int64 :> Get '[JSON] (String, Block String) - :<|> "drafts" :> Capture "draftId" Int64 :> ReqBody '[JSON] (String, Block String) :> Put '[JSON] () - :<|> "drafts" :> Capture "draftId" Int64 :> Delete '[JSON] () -- cgit v1.2.3