package com.red.circle.other.app.inner.service.material.props.impl;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.app.inner.convertor.material.PropsRunningWaterInnerConvertor;
import com.red.circle.other.app.inner.service.material.props.PropsRunningWaterClientService;
import com.red.circle.other.infra.database.rds.service.props.RunningWaterUserPropsService;
import com.red.circle.other.inner.model.cmd.material.RunningWaterUserPropsQryCmd;
import com.red.circle.other.inner.model.dto.material.RunningWaterUserPropsDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 道具流水.
 *
 * @author pengliang on 2023/11/7
 */
@Service
@RequiredArgsConstructor
public class PropsRunningWaterClientServiceImpl implements PropsRunningWaterClientService {

  private final RunningWaterUserPropsService runningWaterUserPropsService;
  private final PropsRunningWaterInnerConvertor propsRunningWaterInnerConvertor;

  @Override
  public PageResult<RunningWaterUserPropsDTO> pageRunningWaterOps(
      RunningWaterUserPropsQryCmd query) {
    return runningWaterUserPropsService.pageRunningWaterUserProps(query)
        .convert(propsRunningWaterInnerConvertor::toRunningWaterUserPropsDTO);
  }

}
