package com.red.circle.other.adapter.app.activity.room;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.clientobject.activity.RewardPoolCO;
import com.red.circle.other.app.dto.clientobject.game.GameKingDataCO;
import com.red.circle.other.app.dto.cmd.activity.RewardPoolCmd;
import com.red.circle.other.app.service.game.GameKingService;
import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 大转盘 - 每周固定活动.
 *
 * @author lisizhe on 2023/9/25
 * @eo.api-type http
 * @eo.groupName 活动服务.大转盘
 * @eo.path /activity/turntable
 */
@RequestMapping("/activity/turntable")
@RestController
@RequiredArgsConstructor
public class TurntableRestController extends BaseController {

  private final GameKingService gameKingService;

  /**
   * 奖励池.
   *
   * @eo.name 奖励池
   * @eo.url /reward
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/reward")
  public List<RewardPoolCO> listRewardPool(RewardPoolCmd cmd) {
    cmd.setType(PropsActivityTypeEnum.THE_BIG_WHEEL);
    cmd.setGroupLimit(7);
    return gameKingService.listRewardPool(cmd);
  }

  /**
   * 历史数据.
   *
   * @eo.name 历史数据
   * @eo.url /history
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/history")
  public List<GameKingDataCO> history(AppExtCommand cmd) {
    return gameKingService.history(cmd);
  }

  /**
   * 本周数据.
   *
   * @eo.name 本周数据
   * @eo.url /this/week
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/this/week")
  public GameKingDataCO thisWeek(AppExtCommand cmd) {
    return gameKingService.thisWeek(cmd);
  }

}
