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

import com.red.circle.other.app.inner.convertor.game.GamePkCountConvertor;
import com.red.circle.other.app.inner.service.game.GamePkClientService;
import com.red.circle.other.infra.database.mongo.service.game.GamePkCountService;
import com.red.circle.other.inner.model.cmd.game.GameRoomPkRecordQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameTeamPkRecordQryCmd;
import com.red.circle.other.inner.model.dto.game.GameRoomPkCountDTO;
import com.red.circle.other.inner.model.dto.game.GameTeamPkCountDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * Game PK
 *
 * @author zongpubin on 2024/1/27
 */
@Service
@RequiredArgsConstructor
public class GamePkClientServiceImpl implements GamePkClientService {

  private final GamePkCountService gamePkCountService;
  private final GamePkCountConvertor gamePkCountConvertor;

  @Override
  public List<GameRoomPkCountDTO> listRoomPk(GameRoomPkRecordQryCmd query) {
    return gamePkCountConvertor.toListGameRoomPkCountDTO(gamePkCountService.listRoomPk(query));
  }

  @Override
  public List<GameTeamPkCountDTO> listTeamPk(GameTeamPkRecordQryCmd query) {
    return gamePkCountConvertor.toListGameTeamPkCountDTO(gamePkCountService.listTeamPk(query));
  }
}
