From dc15ce43d8f4da5eb55c3159e1937c63b8fbef7a Mon Sep 17 00:00:00 2001 From: nek0 Date: Mon, 16 Sep 2019 09:00:11 +0200 Subject: [PATCH] generate links --- src/API.hs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/API.hs b/src/API.hs index 81b6faf..787f3d0 100644 --- a/src/API.hs +++ b/src/API.hs @@ -11,8 +11,11 @@ module API where import Servant.API +import Servant.Links import Servant.RawM +import Data.Proxy + -- internal imports import Types @@ -62,3 +65,35 @@ type MateAPI = :<|> "avatar" :> AuthProtect "header-auth" :> Capture "id" Int :> ReqBody '[JSON] AvatarData :> Patch '[JSON] () :<|> "avatar" :> "list" :> Get '[JSON] [Avatar] + + +( authGetLink :<|> + authSendLink :<|> + authLogoutLink :<|> + + authManageListLink :<|> + authManageNewAuthLink :<|> + authManageDeleteAuthLink :<|> + + userNewLink :<|> + userGetLink :<|> + userUpdateLink :<|> + userListLink :<|> + userRechargeLink :<|> + userTransferLink :<|> + + productNewLink :<|> + productOverviewLink :<|> + productStockRefillLink :<|> + productStockUpdateLink :<|> + productListLink :<|> + + buyLink :<|> + + journalShowLink :<|> + + avatarGetLink :<|> + avaterInsertLink :<|> + avatarUpdateLink :<|> + avatarListLink + ) = allLinks (Proxy :: Proxy MateAPI)