gomod引用

This commit is contained in:
2025-12-12 18:16:28 +08:00
parent a4ba4dd715
commit 465c138f21
11 changed files with 340 additions and 403 deletions

View File

@@ -2,13 +2,16 @@ package dto
import (
"time"
"github.com/gogf/gf/v2/frame/g"
)
// CreateOrderReq 创建订单请求
type CreateOrderReq struct {
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
UserID string `json:"user_id" binding:"required"` // 户ID
g.Meta `path:"/create" method:"post" tags:"订单管理" summary:"创建订单" dc:"创建新订单"`
TenantID interface{} `json:"tenant_id" binding:"required"` // 户ID
UserID int64 `json:"user_id" binding:"required"` // 用户ID
OrderType string `json:"order_type" binding:"required"` // 订单类型
Subject string `json:"subject" binding:"required"` // 订单标题
Description string `json:"description"` // 订单描述
@@ -58,6 +61,7 @@ type CreateOrderResp struct {
// PayOrderReq 支付订单请求
type PayOrderReq struct {
g.Meta `path:"/pay" method:"post" tags:"订单管理" summary:"支付订单" dc:"发起订单支付"`
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
OrderNo string `json:"order_no" binding:"required"` // 订单号
PayMethod string `json:"pay_method" binding:"required"` // 支付方式wechat/alipay
@@ -82,6 +86,7 @@ type PayOrderResp struct {
// QueryOrderReq 查询订单请求
type QueryOrderReq struct {
g.Meta `path:"/query" method:"get" tags:"订单管理" summary:"查询订单详情" dc:"根据订单号查询订单详情"`
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
OrderNo string `json:"order_no" binding:"required"` // 订单号
}
@@ -96,7 +101,7 @@ type QueryOrderResp struct {
type OrderDetail struct {
ID string `json:"id"` // 订单ID
TenantID string `json:"tenant_id"` // 租户ID
TenantID interface{} `json:"tenant_id"` // 租户ID
OrderNo string `json:"order_no"` // 订单号
UserID int64 `json:"user_id"` // 用户ID
TotalAmount int64 `json:"total_amount"` // 订单总金额
@@ -161,6 +166,7 @@ type PayInfo struct {
// CancelOrderReq 取消订单请求
type CancelOrderReq struct {
g.Meta `path:"/cancel" method:"post" tags:"订单管理" summary:"取消订单" dc:"取消指定订单"`
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
OrderNo string `json:"order_no" binding:"required"` // 订单号
Reason string `json:"reason"` // 取消原因
@@ -176,6 +182,7 @@ type CancelOrderResp struct {
// RefundOrderReq 退款请求
type RefundOrderReq struct {
g.Meta `path:"/refund" method:"post" tags:"订单管理" summary:"订单退款" dc:"发起订单退款"`
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
OrderNo string `json:"order_no" binding:"required"` // 订单号
RefundAmount int64 `json:"refund_amount" binding:"required"` // 退款金额(分)
@@ -193,6 +200,7 @@ type RefundOrderResp struct {
// ListOrdersReq 订单列表请求
type ListOrdersReq struct {
g.Meta `path:"/orders" method:"get" tags:"订单管理" summary:"订单列表" dc:"分页查询订单列表"`
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
UserID string `json:"user_id"` // 用户ID可选
Status string `json:"status"` // 订单状态(可选)
@@ -225,6 +233,7 @@ type OrderSummary struct {
// PaymentNotifyReq 支付回调请求
type PaymentNotifyReq struct {
g.Meta `path:"/paymentNotify" method:"post" tags:"支付管理" summary:"支付回调" dc:"处理支付平台回调通知"`
TenantID string `json:"tenant_id"` // 租户ID
OrderNo string `json:"order_no"` // 订单号
PayMethod string `json:"pay_method"` // 支付方式
@@ -243,6 +252,7 @@ type PaymentNotifyResp struct {
// RefundNotifyReq 退款回调请求
type RefundNotifyReq struct {
g.Meta `path:"/refundNotify" method:"post" tags:"退款管理" summary:"退款回调" dc:"处理退款平台回调通知"`
TenantID string `json:"tenant_id"` // 租户ID
RefundNo string `json:"refund_no"` // 退款单号
Status string `json:"status"` // 退款状态
@@ -256,85 +266,9 @@ type RefundNotifyResp struct {
Success bool `json:"success"` // 是否成功
}
// CreatePaymentConfigReq 创建支付配置请求
// CommonResp 通用响应
type CreatePaymentConfigReq struct {
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
PayMethod string `json:"pay_method" binding:"required"` // 支付方式wechat/alipay
ConfigName string `json:"config_name" binding:"required"` // 配置名称
Remark string `json:"remark"` // 备注
IsEnabled bool `json:"is_enabled"` // 是否启用
Config map[string]interface{} `json:"config" binding:"required"` // 配置参数
}
// UpdatePaymentConfigReq 更新支付配置请求
type UpdatePaymentConfigReq struct {
ID string `json:"id" binding:"required"` // 配置ID
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
ConfigName string `json:"config_name" binding:"required"` // 配置名称
Remark string `json:"remark"` // 备注
IsEnabled bool `json:"is_enabled"` // 是否启用
Config map[string]interface{} `json:"config" binding:"required"` // 配置参数
}
// QueryPaymentConfigReq 查询支付配置请求
type QueryPaymentConfigReq struct {
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
PayMethod string `json:"pay_method"` // 支付方式(可选)
}
// PaymentConfigResp 支付配置响应
type PaymentConfigResp struct {
ID string `json:"id"` // 配置ID
TenantID string `json:"tenant_id"` // 租户ID
PayMethod string `json:"pay_method"` // 支付方式
ConfigName string `json:"config_name"` // 配置名称
Remark string `json:"remark"` // 备注
IsEnabled bool `json:"is_enabled"` // 是否启用
Config map[string]interface{} `json:"config"` // 配置参数
CreatedAt time.Time `json:"created_at"` // 创建时间
UpdatedAt time.Time `json:"updated_at"` // 更新时间
}
// WechatConfig 微信支付配置
type WechatConfig struct {
ID string `json:"id"` // 配置ID
TenantID string `json:"tenant_id"` // 租户ID
ConfigName string `json:"config_name"` // 配置名称
AppID string `json:"app_id"` // 应用ID
MchID string `json:"mch_id"` // 商户号
APIKey string `json:"api_key"` // API密钥
NotifyURL string `json:"notify_url"` // 回调地址
ReturnURL string `json:"return_url"` // 返回地址
CertPath string `json:"cert_path"` // 证书路径
KeyPath string `json:"key_path"` // 密钥路径
Sandbox bool `json:"sandbox"` // 是否沙箱环境
SupportNative bool `json:"support_native"` // 支持扫码支付
SupportJSAPI bool `json:"support_jsapi"` // 支持JSAPI支付
SupportAPP bool `json:"support_app"` // 支持APP支付
SupportH5 bool `json:"support_h5"` // 支持H5支付
GatewayURL string `json:"gateway_url"` // 网关地址
}
// AlipayConfig 支付宝支付配置
type AlipayConfig struct {
ID string `json:"id"` // 配置ID
TenantID string `json:"tenant_id"` // 租户ID
ConfigName string `json:"config_name"` // 配置名称
AppID string `json:"app_id"` // 应用ID
NotifyURL string `json:"notify_url"` // 回调地址
ReturnURL string `json:"return_url"` // 返回地址
AppPrivateKey string `json:"app_private_key"` // 应用私钥
AlipayPublicKey string `json:"alipay_public_key"` // 支付宝公钥
Sandbox bool `json:"sandbox"` // 是否沙箱环境
GatewayURL string `json:"gateway_url"` // 网关地址
SupportNative bool `json:"support_native"` // 支持扫码支付
SupportJSAPI bool `json:"support_jsapi"` // 支持JSAPI支付
SupportAPP bool `json:"support_app"` // 支持APP支付
SupportH5 bool `json:"support_h5"` // 支持H5支付
type CommonResp struct {
Success bool `json:"success"` // 是否成功
Message string `json:"message"` // 消息
}