add: some user api and all api desc
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
WalletBalance {
|
||||
Balance float64 `json:"balance"`
|
||||
FrozenBalance float64 `json:"frozenBalance"`
|
||||
}
|
||||
|
||||
Transaction {
|
||||
Id string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Amount float64 `json:"amount"`
|
||||
Description string `json:"description"`
|
||||
OrderId string `json:"orderId,optional"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
|
||||
TransactionListResp {
|
||||
Items []Transaction `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
TopupReq {
|
||||
Amount float64 `json:"amount"`
|
||||
Method string `json:"method"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1/wallet
|
||||
group: wallet
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取余额"
|
||||
@handler GetBalance
|
||||
get /balance (EmptyResp) returns (WalletBalance)
|
||||
|
||||
@doc "获取流水"
|
||||
@handler ListTransactions
|
||||
get /transactions (PageReq) returns (TransactionListResp)
|
||||
|
||||
@doc "充值"
|
||||
@handler Topup
|
||||
post /topup (TopupReq) returns (EmptyResp)
|
||||
|
||||
@doc "提现"
|
||||
@handler Withdraw
|
||||
post /withdraw (TopupReq) returns (EmptyResp)
|
||||
}
|
||||
Reference in New Issue
Block a user