This commit is contained in:
momo
2023-11-16 16:35:22 +08:00
parent 2aae36dfca
commit b045d44d14
7 changed files with 15 additions and 113 deletions

View File

@@ -1,35 +0,0 @@
package handler
import (
"net/http"
"reflect"
"fusenapi/utils/basic"
"fusenapi/server/pay/internal/logic"
"fusenapi/server/pay/internal/svc"
"fusenapi/server/pay/internal/types"
)
func OrderRefundHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.OrderRefundReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewOrderRefundLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.OrderRefund(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}

View File

@@ -12,11 +12,6 @@ import (
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/api/pay/refund",
Handler: OrderRefundHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/pay/stripe-webhook",