package com.red.circle.wallet.app.command.bean.query;

import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
import com.red.circle.wallet.domain.gateway.WalletBeanGateway;
import java.math.BigDecimal;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 豆子余额.
 *
 * @author pengliang on 2021/10/16
 */
@Component
@RequiredArgsConstructor
public class BeanBalanceQryExe {

  private final WalletBeanGateway walletBeanGateway;

  public BigDecimal execute(AppUserIdCmd cmd) {
    return walletBeanGateway.getBalance(cmd.getUserId());
  }

}
