package com.red.circle.other.app.inner.service.sys.impl;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.app.inner.convertor.sys.ReportedUserInnerConvertor;
import com.red.circle.other.app.inner.service.sys.ReportedUserClientService;
import com.red.circle.other.infra.database.rds.service.sys.ReportedUserService;
import com.red.circle.other.inner.model.cmd.approval.ApprovalReportedCmd;
import com.red.circle.other.inner.model.cmd.sys.SysReportedQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysReportedUserDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 被举报用户 服务实现类
 * </p>
 *
 * @author pengliang
 * @since 2019-10-31
 */
@Service
@RequiredArgsConstructor
public class ReportedUserClientServiceImpl implements ReportedUserClientService {

  private final ReportedUserService reportedUserService;
  private final ReportedUserInnerConvertor reportedUserInnerConvertor;

  @Override
  public PageResult<SysReportedUserDTO> pageSysReportedUser(SysReportedQryCmd sysReportedQuery) {
    return reportedUserService.pageSysReportedUser(sysReportedQuery)
        .convert(reportedUserInnerConvertor::toSysReportedUserDTO);
  }

  @Override
  public void approvalReported(ApprovalReportedCmd cmd) {
    reportedUserService.approvalReported(cmd);
  }

}
