Ai
1 Star 1 Fork 0

codeboyzhou/design-pattern

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SilverUserPaymentStrategy.java 391 Bytes
一键复制 编辑 原始数据 按行查看 历史
codeboyzhou 提交于 2020-05-08 11:16 +08:00 . 策略模式及其优化
package com.gitee.designpattern.strategy;
import java.math.BigDecimal;
/**
* 白银用户支付策略
*
* @author codeboy zhou
*/
@UserVipLevel(UserVipLevelEnum.SILVER)
public class SilverUserPaymentStrategy implements UserPaymentStrategy {
@Override
public BigDecimal needPay(BigDecimal originalMoney) {
return originalMoney.multiply(BigDecimal.valueOf(0.8));
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/codeboyzz/design-pattern.git
git@gitee.com:codeboyzz/design-pattern.git
codeboyzz
design-pattern
design-pattern
master

搜索帮助