package co.yixiang.yshop.module.member.service.integralrule.strategy.impl;

import co.yixiang.yshop.module.member.api.integralRule.IntegralRuleDTO;
import co.yixiang.yshop.module.member.service.integralrule.strategy.AbstractIntegralRuleStrategy;
import co.yixiang.yshop.module.member.service.user.MemberUserService;
import co.yixiang.yshop.module.member.service.user.UserService;
import co.yixiang.yshop.module.member.service.userbill.UserBillService;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author pepis
 * @apiNote
 **/
@Component
public class DefaultIntegralRuleStrategy extends AbstractIntegralRuleStrategy {
    public DefaultIntegralRuleStrategy(MemberUserService userService, UserBillService userBillService) {
        super(userService, userBillService);
    }

    @Override
    public BigDecimal calculate(IntegralRuleDTO rule) {
        return BigDecimal.valueOf(rule.getIntegral());
    }
}
