feat(points): 增加双边积分与虚拟积分商城

This commit is contained in:
yml2213
2026-11-04 19:21:02 +08:00
parent c00d691301
commit d5abe67f60
42 changed files with 2593 additions and 316 deletions
+22
View File
@@ -35,6 +35,7 @@ import (
"hfb_sys/backend/internal/modules/paymentaccount"
"hfb_sys/backend/internal/modules/paymentconfig"
"hfb_sys/backend/internal/modules/pickup"
"hfb_sys/backend/internal/modules/pointsmall"
"hfb_sys/backend/internal/modules/qualityowner"
"hfb_sys/backend/internal/modules/realname"
"hfb_sys/backend/internal/modules/supportgroup"
@@ -319,6 +320,11 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
systemConfigHandler := systemconfig.NewHandler(systemConfigService)
qualityOwnerService := qualityowner.NewService(qualityOwnerRepo)
qualityOwnerHandler := qualityowner.NewHandler(qualityOwnerService)
var pointsMallRepo *pointsmall.Repository
if deps.DB != nil {
pointsMallRepo = pointsmall.NewRepository(deps.DB)
}
pointsMallHandler := pointsmall.NewHandler(pointsmall.NewService(pointsMallRepo))
var distributionRepo *distribution.Repository
if deps.DB != nil {
distributionRepo = distribution.NewRepository(deps.DB, deps.Redis)
@@ -495,6 +501,17 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
qualityOwnerRoutes.POST("/payment", requireRealname, paymentHandler.StartQualityOwner)
qualityOwnerRoutes.GET("/payment", paymentHandler.QueryQualityOwner)
}
pointsRoutes := api.Group("/points", requireAuth)
{
pointsRoutes.GET("/summary", pointsMallHandler.Summary)
pointsRoutes.GET("/ledger", pointsMallHandler.Ledger)
}
pointsMallRoutes := api.Group("/points-mall", requireAuth)
{
pointsMallRoutes.GET("/products", pointsMallHandler.Products)
pointsMallRoutes.POST("/products/:id/redeem", pointsMallHandler.Redeem)
pointsMallRoutes.GET("/redemptions", pointsMallHandler.MyRedemptions)
}
if invitationHandler != nil {
api.GET("/invitations/code-info", invitationHandler.GetInviteInfo)
@@ -788,6 +805,11 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
adminRoutes.POST("/users/:id/revoke-realname", requirePerm("user:revoke_realname"), adminUserHandler.RevokeRealname)
adminRoutes.POST("/users/:id/wallet/adjust", requirePerm("user:wallet_adjust"), adminUserHandler.AdjustWallet)
adminRoutes.POST("/users/:id/quality-owner", requirePerm("user:quality_owner"), qualityOwnerHandler.AdminSet)
adminRoutes.GET("/points-mall/products", requirePerm("points_mall:view"), pointsMallHandler.AdminProducts)
adminRoutes.POST("/points-mall/products", requirePerm("points_mall:manage"), pointsMallHandler.CreateProduct)
adminRoutes.PUT("/points-mall/products/:id", requirePerm("points_mall:manage"), pointsMallHandler.UpdateProduct)
adminRoutes.GET("/points-mall/redemptions", requirePerm("points_mall:view"), pointsMallHandler.AdminRedemptions)
adminRoutes.POST("/points-mall/redemptions/:id/complete", requirePerm("points_mall:manage"), pointsMallHandler.CompleteRedemption)
adminRoutes.GET("/orders", requirePerm("order:list"), orderHandler.AdminList)
adminRoutes.GET("/listing-orders/:id/latest", requirePerm("order:view"), orderHandler.AdminLatestByListing)
adminRoutes.GET("/orders/:id", requirePerm("order:view"), orderHandler.AdminDetail)