This commit is contained in:
2025-07-11 21:05:58 +08:00
parent 5b4392894f
commit e3d64e7485
74 changed files with 14379 additions and 697 deletions

View File

@@ -0,0 +1,35 @@
package routes
import (
"github.com/gin-gonic/gin"
"tyapi-server/internal/domains/finance/handlers"
)
// RegisterFinanceRoutes 注册财务路由
func RegisterFinanceRoutes(router *gin.Engine, financeHandler *handlers.FinanceHandler) {
// 财务路由组
financeGroup := router.Group("/api/finance")
{
// 钱包相关路由
walletGroup := financeGroup.Group("/wallet")
{
walletGroup.POST("", financeHandler.CreateWallet) // 创建钱包
walletGroup.GET("", financeHandler.GetWallet) // 获取钱包信息
walletGroup.PUT("", financeHandler.UpdateWallet) // 更新钱包
walletGroup.POST("/recharge", financeHandler.Recharge) // 充值
walletGroup.POST("/withdraw", financeHandler.Withdraw) // 提现
walletGroup.POST("/transaction", financeHandler.WalletTransaction) // 钱包交易
walletGroup.GET("/stats", financeHandler.GetWalletStats) // 获取钱包统计
}
// 用户密钥相关路由
secretsGroup := financeGroup.Group("/secrets")
{
secretsGroup.POST("", financeHandler.CreateUserSecrets) // 创建用户密钥
secretsGroup.GET("", financeHandler.GetUserSecrets) // 获取用户密钥
secretsGroup.POST("/regenerate", financeHandler.RegenerateAccessKey) // 重新生成访问密钥
secretsGroup.POST("/deactivate", financeHandler.DeactivateUserSecrets) // 停用用户密钥
}
}
}