fix(订单): 修复折扣计算问题并添加四舍五入处理
Build docker and publish / build (20.15.1) (push) Successful in 6m53s

统一处理百分比和系数两种折扣输入方式,增加边界保护
在金额计算中使用math.Round进行四舍五入处理
添加相关单元测试确保计算准确性
This commit is contained in:
2025-12-02 02:22:09 -08:00
parent fcdd6ac170
commit 9987bd43fa
15 changed files with 206 additions and 30 deletions
+2 -1
View File
@@ -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())