package com.red.circle.other.app.service.activity;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.common.business.dto.cmd.app.AppTypeCmd;
import com.red.circle.other.app.command.activity.query.FanVotesActivityCountdownQueryExe;
import com.red.circle.other.app.command.activity.query.FanVotesActivityStatusQueryExe;
import com.red.circle.other.app.command.activity.query.FanVotesListQueryExe;
import com.red.circle.other.app.common.props.GroupRewardPoolCommon;
import com.red.circle.other.app.dto.clientobject.activity.RoomProfileCO;
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardProps;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 房间粉丝人气票活动.
 *
 * @author pengshigang on 2023/6/10
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class RoomFanVotesActivityServiceImpl implements RoomFanVotesActivityService {

  private final FanVotesListQueryExe fanVotesListQueryExe;
  private final GroupRewardPoolCommon groupRewardPoolCommon;
  private final FanVotesActivityStatusQueryExe fanVotesActivityStatusQueryExe;
  private final FanVotesActivityCountdownQueryExe fanVotesActivityCountdownQueryExe;


  @Override
  public List<RoomProfileCO> listRoom(AppTypeCmd cmd) {
    return fanVotesListQueryExe.execute(cmd);
  }

  @Override
  public List<List<ActivityRewardProps>> listRewardPool(AppExtCommand cmd) {

    return groupRewardPoolCommon
        .listRewardProps(cmd.requireReqSysOriginEnum(),
            PropsActivityTypeEnum.ROOM_FAN_VOTES_ACTIVITY);

  }

  @Override
  public Long getCountdown(AppExtCommand cmd) {
    return fanVotesActivityCountdownQueryExe.execute(cmd);
  }

  @Override
  public Boolean getActivityStatus(AppExtCommand cmd) {
    return fanVotesActivityStatusQueryExe.execute(cmd);
  }
}
