package com.red.circle.order.app.command.pay;

import com.red.circle.common.business.dto.cmd.IdLongCmd;
import com.red.circle.order.app.convertor.PayAppConvertor;
import com.red.circle.order.app.dto.clientobject.pay.PayApplicationCO;
import com.red.circle.order.infra.database.rds.service.pay.PayApplicationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 获取应用信息.
 *
 * @author pengliang on 2023/9/27
 */
@Component
@RequiredArgsConstructor
public class PayApplicationQryExe {

  private final PayAppConvertor payAppConvertor;
  private final PayApplicationService payApplicationService;

  public PayApplicationCO execute(IdLongCmd cmd) {
    return payAppConvertor.toPayApplicationCO(payApplicationService.getById(cmd.getId()));
  }

}
