package com.red.circle.order.inner.service.impl;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.order.infra.database.rds.service.count.MonthlyRechargeUserService;
import com.red.circle.order.inner.convertor.MonthlyRechargeConvertor;
import com.red.circle.order.inner.model.cmd.MonthlyRechargePageTableQry;
import com.red.circle.order.inner.model.cmd.QualityUserMonthlyPageTableQry;
import com.red.circle.order.inner.model.dto.MonthlyRechargeUserDTO;
import com.red.circle.order.inner.service.MonthlyRechargeUserClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 每月充值用户.
 *
 * @author pengliang on 2024/1/23
 */
@Service
@RequiredArgsConstructor
public class MonthlyRechargeUserClientServiceImpl implements MonthlyRechargeUserClientService {

  private final MonthlyRechargeConvertor monthlyRechargeConvertor;
  private final MonthlyRechargeUserService monthlyRechargeUserService;

  @Override
  public PageResult<MonthlyRechargeUserDTO> opsPageQuery(QualityUserMonthlyPageTableQry qry) {
    return monthlyRechargeConvertor.toPageMonthlyRechargeUserDTO(
        monthlyRechargeUserService.opsPageQuery(
            qry.getPageQuery()
            , qry.getSysOrigin()
            , qry.getUserId()
            , qry.getRechargeDate()
        )
    );

  }

  @Override
  public PageResult<MonthlyRechargeUserDTO> opsPageMonthlyQuery(
      MonthlyRechargePageTableQry qry) {
    return monthlyRechargeConvertor.toPageMonthlyRechargeUserDTO(
        monthlyRechargeUserService.opsPageQuery(
            qry.getPageQuery()
            , qry.getUserId()
        )
    );
  }

}
