feat(user): 该更支付模式,查询模式
This commit is contained in:
@@ -7,12 +7,15 @@ info (
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
import (
|
||||
"pay/pay.api"
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
)
|
||||
service main {
|
||||
|
||||
// 微信支付回调
|
||||
@handler WechatPayCallback
|
||||
post /pay/wechat/callback
|
||||
@@ -26,3 +29,13 @@ service main {
|
||||
post /pay/wechat/refund_callback
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
// 支付
|
||||
@handler Payment
|
||||
post /pay/payment (PaymentReq) returns (PaymentResp)
|
||||
}
|
||||
22
app/user/cmd/api/desc/pay/pay.api
Normal file
22
app/user/cmd/api/desc/pay/pay.api
Normal file
@@ -0,0 +1,22 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品支付服务"
|
||||
desc: "产品支付服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
)
|
||||
|
||||
type (
|
||||
PaymentReq {
|
||||
Id string `json:"id"`
|
||||
PayMethod string `json:"pay_method"`
|
||||
}
|
||||
PaymentResp {
|
||||
prepayID string `json:"prepay_id"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +60,10 @@ service main {
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取查询临时订单"
|
||||
@handler queryProvisionalOrder
|
||||
get /query/provisional_order/:id (QueryProvisionalOrderReq) returns (QueryProvisionalOrderResp)
|
||||
|
||||
@doc "查询示例"
|
||||
@handler queryExample
|
||||
get /query/example (QueryExampleReq) returns (QueryExampleResp)
|
||||
@@ -79,6 +83,4 @@ service main {
|
||||
@doc "重试查询"
|
||||
@handler queryRetry
|
||||
post /query/retry/:id (QueryRetryReq) returns (QueryRetryResp)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ type (
|
||||
Data string `json:"data" validate:"required"`
|
||||
}
|
||||
QueryResp {
|
||||
prepayID string `json:"prepay_id"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
id string `json:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@@ -28,6 +27,19 @@ type Query {
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
}
|
||||
|
||||
// 获取查询临时订单
|
||||
type (
|
||||
QueryProvisionalOrderReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
QueryProvisionalOrderResp {
|
||||
Name string `json:"name"`
|
||||
IdCard string `json:"id_card"`
|
||||
Mobile string `json:"mobile"`
|
||||
Product Product `json:"product"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
|
||||
Reference in New Issue
Block a user