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

import com.red.circle.other.app.inner.convertor.game.GameTrumpetCountInnerConvertor;
import com.red.circle.other.app.inner.service.game.GameTrumpetCountClientService;
import com.red.circle.other.infra.database.mongo.service.game.GameTrumpetCountService;
import com.red.circle.other.inner.model.cmd.game.GameTrumpetQryCmd;
import com.red.circle.other.inner.model.dto.game.GameTrumpetCountDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 喇叭.
 *
 * @author pengliang on 2023/12/23
 */
@Service
@RequiredArgsConstructor
public class GameTrumpetCountClientServiceImpl implements GameTrumpetCountClientService {

  private final GameTrumpetCountService gameTrumpetCountService;
  private final GameTrumpetCountInnerConvertor gameTrumpetCountInnerConvertor;

  @Override
  public List<GameTrumpetCountDTO> opsList(GameTrumpetQryCmd query) {
    return gameTrumpetCountInnerConvertor.toListGameTrumpetCountDTO(
        gameTrumpetCountService.list(
            gameTrumpetCountInnerConvertor.toGameTrumpetQuery(query)
        )
    );
  }

  @Override
  public void delete(Long id, Long updateUser) {
    gameTrumpetCountService.deleteById(id, updateUser);
  }

}
