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.UserLogoutLogClientService;
import com.red.circle.other.infra.database.rds.entity.user.user.LogoutLog;
import com.red.circle.other.infra.database.rds.service.user.user.LogoutLogService;
import com.red.circle.other.inner.model.cmd.user.UserLogoutLogQryCmd;
import com.red.circle.other.inner.model.dto.user.UserLogoutLogDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户注销记录
 * @author zongpubin on 2024/2/27
 */
@Service
@RequiredArgsConstructor
public class UserLogoutLogClientServiceImpl implements UserLogoutLogClientService {

  private final LogoutLogService logoutLogService;
  private final UserLogoutInnerConvertor userLogoutInnerConvertor;

  @Override
  public PageResult<UserLogoutLogDTO> pageUserLogoutLog(UserLogoutLogQryCmd query) {
    PageResult<LogoutLog> pageResult = logoutLogService.pageUserLogoutLog(query);
    return pageResult.convert(userLogoutInnerConvertor::toUserLogoutLogDTO);
  }
}
