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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.app.inner.convertor.user.UserLogoutInnerConvertor;
import com.red.circle.other.app.inner.service.user.user.UserLogoutApplyClientService;
import com.red.circle.other.infra.database.rds.entity.user.user.LogoutApply;
import com.red.circle.other.infra.database.rds.service.user.user.LogoutApplyService;
import com.red.circle.other.inner.model.cmd.user.UserLogoutApplyQryCmd;
import com.red.circle.other.inner.model.dto.user.UserLogoutApplyDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户注销web页面申请
 *
 * @author zongpubin on 2024/2/27
 */
@Service
@RequiredArgsConstructor
public class UserLogoutApplyClientServiceImpl implements UserLogoutApplyClientService {

  private final LogoutApplyService logoutApplyService;
  private final UserLogoutInnerConvertor userLogoutInnerConvertor;

  @Override
  public PageResult<UserLogoutApplyDTO> pageUserLogoutApply(UserLogoutApplyQryCmd query) {
    PageResult<LogoutApply> pageResult = logoutApplyService.pageUserLogoutApply(query);
    return pageResult.convert(userLogoutInnerConvertor::toUserLogoutApplyDTO);
  }
}
