package com.red.circle.wallet.app.command.auth;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.wallet.infra.database.rds.service.auth.PayAuthService;
import java.util.Objects;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 支付密码
 *
 * @author zongpubin on 2023/12/1
 */
@Component
@AllArgsConstructor
public class PayPwdQryExe {

  private final PayAuthService payAuthService;

  public Boolean execute(AppExtCommand cmd) {
    if (cmd.originEqAswat() && cmd.originEqAswat()) {
      return Objects.nonNull(payAuthService.getByUserId(cmd.requiredReqUserId()));
    }
    return Boolean.TRUE;
  }
}
