Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Latest commit

 

History

History
22 lines (13 loc) · 580 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 580 Bytes

砍价规则

受简书拼多多砍价算法实现探究启发,写了Java版本的拼多多砍价规则。

使用说明

假如可砍价的总金额为100,需要砍价10次,前5个人可砍掉70%。

PingDuoDuoReduceRule pingRule = new PingDuoDuoReduceRule(70, 5);
pingRule.getReduceList(new BigDecimal("100"), 10);

接口说明

ReduceRule

该接口及其实现类一次性生成全部砍价金额列表。

StatelessReduceRule

该接口及其实现类一次调用只生成当次的砍价金额。