add recharge routine
This commit is contained in:
parent
745780486b
commit
aab443cc92
3 changed files with 15 additions and 0 deletions
|
@ -34,6 +34,8 @@ type UserAPI =
|
||||||
:> Capture "uid'" Int :> ReqBody '[JSON] UserDetailsSubmit :> Patch '[JSON] ()
|
:> Capture "uid'" Int :> ReqBody '[JSON] UserDetailsSubmit :> Patch '[JSON] ()
|
||||||
:<|> "user" :> "list" :> AuthProtect "header-auth"
|
:<|> "user" :> "list" :> AuthProtect "header-auth"
|
||||||
:> QueryParam "refine" Refine :> Get '[JSON] [User]
|
:> QueryParam "refine" Refine :> Get '[JSON] [User]
|
||||||
|
:<|> "user" :> "recharge" :> AuthProtect "header-auth"
|
||||||
|
:> ReqBody '[JSON] UserRecharge :> Post '[JSON] ()
|
||||||
|
|
||||||
:<|> "product" :> AuthProtect "header-auth" :> ReqBody '[JSON] ProductSubmit
|
:<|> "product" :> AuthProtect "header-auth" :> ReqBody '[JSON] ProductSubmit
|
||||||
:> Post '[JSON] Int
|
:> Post '[JSON] Int
|
||||||
|
|
|
@ -75,6 +75,7 @@ app initState =
|
||||||
userGet :<|>
|
userGet :<|>
|
||||||
userUpdate :<|>
|
userUpdate :<|>
|
||||||
userList :<|>
|
userList :<|>
|
||||||
|
userRecharge :<|>
|
||||||
|
|
||||||
productNew :<|>
|
productNew :<|>
|
||||||
productOverview :<|>
|
productOverview :<|>
|
||||||
|
|
|
@ -81,3 +81,15 @@ instance ToJSON UserDetailsSubmit where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|
||||||
instance FromJSON UserDetailsSubmit
|
instance FromJSON UserDetailsSubmit
|
||||||
|
|
||||||
|
|
||||||
|
data UserRecharge = UserRecharge
|
||||||
|
{ userRechargeId :: Int
|
||||||
|
, userRechargeAmount :: Int
|
||||||
|
}
|
||||||
|
deriving (Generic, Show)
|
||||||
|
|
||||||
|
instance ToJSON UserRecharge where
|
||||||
|
toEncoding = genericToEncoding defaultOptions
|
||||||
|
|
||||||
|
instance FromJSON UserRecharge
|
||||||
|
|
Loading…
Reference in a new issue