package com.red.circle.other.app.command.game.ktv;

import com.google.common.collect.Maps;
import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
import com.red.circle.other.infra.database.cache.service.other.GameKtvCacheService;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * KTV倒计时.
 *
 * @author pengshigang on 2023/5/11
 */
@Component
@RequiredArgsConstructor
public class GameKtvCountDownQueryExe {

  private final GameKtvCacheService gameKtvCacheService;

  public Map<String, Long> execute(AppRoomIdCmd cmd) {

    Map<String, Long> map = Maps.newHashMap();
    map.put("waitCountDown", gameKtvCacheService.getWaitCountDown(cmd.getRoomId()));
    map.put("songCountDown", gameKtvCacheService.getSongCountDown(cmd.getRoomId()));

    return map;
  }

}
