统一处理百分比和系数两种折扣输入方式,增加边界保护 在金额计算中使用math.Round进行四舍五入处理 添加相关单元测试确保计算准确性
This commit is contained in:
@@ -84,7 +84,8 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
err = rds.Ping(context.Background()).Err()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
} else {
|
||||
}
|
||||
if c.Debug {
|
||||
_ = rds.FlushAll(context.Background()).Err()
|
||||
}
|
||||
authLimiter := limit.NewPeriodLimit(86400, 15, rds, config.SendCountLimitKeyPrefix, limit.Align())
|
||||
|
||||
Reference in New Issue
Block a user