feat(benefits): 增加权益中心
This commit is contained in:
@@ -35,6 +35,17 @@ func (r *Repository) Summary(ctx context.Context, userID uint64) (*SummaryDTO, e
|
||||
return nil, err
|
||||
}
|
||||
level := rentergrowth.LevelForPoints(cfg, user.RenterGrowthPoints)
|
||||
levels := make([]GrowthLevelDTO, 0, len(cfg.Levels))
|
||||
for _, item := range cfg.Levels {
|
||||
levels = append(levels, GrowthLevelDTO{
|
||||
Code: item.Code,
|
||||
Name: item.Name,
|
||||
MinPoints: item.MinPoints,
|
||||
PointsMultiplierBps: item.PointsMultiplierBps,
|
||||
DiscountBps: item.DiscountBps,
|
||||
DepositFreeQuotaCent: item.DepositFreeQuotaCent,
|
||||
})
|
||||
}
|
||||
return &SummaryDTO{
|
||||
AvailablePoints: user.PointsAvailable,
|
||||
LifetimePoints: user.RenterGrowthPoints,
|
||||
@@ -42,6 +53,8 @@ func (r *Repository) Summary(ctx context.Context, userID uint64) (*SummaryDTO, e
|
||||
LevelName: level.Name,
|
||||
PointsPerYuan: cfg.PointsPerYuan,
|
||||
PointsMultiplierBps: level.PointsMultiplierBps,
|
||||
GrowthEnabled: cfg.Enabled,
|
||||
Levels: levels,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user