初始化

This commit is contained in:
2026-07-18 05:58:41 +08:00
commit e4b95eb05e
69 changed files with 2289 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
package payment
// ControllerV1 是支付回调控制器。
type ControllerV1 struct{}
// NewV1 创建支付回调控制器实例。
func NewV1() *ControllerV1 {
return &ControllerV1{}
}

View File

@@ -0,0 +1,21 @@
package payment
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"xk-of-api/api/payment/v1"
"xk-of-api/internal/response"
"xk-of-api/internal/service"
)
// Notify 接收支付渠道回调,后续在 service 中扩展验签和状态流转。
func (c *ControllerV1) Notify(ctx context.Context, req *v1.NotifyReq) (res *v1.NotifyRes, err error) {
if req.Channel == "" {
response.Error(ctx, 400, "支付渠道不能为空")
return nil, nil
}
response.Success(ctx, service.Order.Notify(req.Channel, g.RequestFromCtx(ctx).GetMap()))
return nil, nil
}