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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.infra.database.rds.service.user.user.LoginLoggerService;
import com.red.circle.other.app.inner.convertor.user.UserAccountInnerConvertor;
import com.red.circle.other.inner.model.cmd.user.LoginLogQryCmd;
import com.red.circle.other.inner.model.dto.user.UserLoginLoggerDTO;
import com.red.circle.other.app.inner.service.user.user.UserLoginClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户登录.
 *
 * @author pengliang on 2023/10/17
 */
@Service
@RequiredArgsConstructor
public class UserLoginClientServiceImpl implements
    UserLoginClientService {

  private final LoginLoggerService loginLoggerService;
  private final UserAccountInnerConvertor userAccountInnerConvertor;

  @Override
  public PageResult<UserLoginLoggerDTO> pageLoginLogger(LoginLogQryCmd cmd) {
    return loginLoggerService.pageLoginLogger(cmd)
        .convert(userAccountInnerConvertor::toUserLoginLoggerDTO);
  }
}
