package com.red.circle.game.fruit.adapter.endpoint;

import com.red.circle.common.business.dto.cmd.PageUserIdCmd;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.game.fruit.application.endpoint.GameFruitHistoryClientService;
import com.red.circle.game.fruit.inner.endpoint.api.GameFruitHistoryClientApi;
import com.red.circle.game.fruit.inner.model.cmd.GameDataStatisticalCmd;
import com.red.circle.game.fruit.inner.model.cmd.PageDaysRecordQryCmd;
import com.red.circle.game.fruit.inner.model.dto.DaysRecordDTO;
import com.red.circle.game.fruit.inner.model.dto.GameDataStatisticalDTO;
import com.red.circle.game.fruit.inner.model.dto.PageGameUserDaysDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 摩天轮游戏配置相关
 *
 * @author zongpubin on 2023/12/13
 */
@Validated
@RestController
@RequestMapping(value = GameFruitHistoryClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GameFruitHistoryClientEndpoint implements GameFruitHistoryClientApi {

  private final GameFruitHistoryClientService gameFruitHistoryClientService;


  @Override
  public ResultResponse<DaysRecordDTO> pageGameFruitDaysRecord(
      PageDaysRecordQryCmd cmd) {
    return ResultResponse.success(gameFruitHistoryClientService.pageGameFruitDaysRecord(cmd));
  }

  @Override
  public ResultResponse<GameDataStatisticalDTO> pageUserBetRecord(GameDataStatisticalCmd cmd) {
    return ResultResponse.success(gameFruitHistoryClientService.pageUserBetRecord(cmd));
  }

  @Override
  public ResultResponse<PageResult<PageGameUserDaysDTO>> pageDaysUserData(PageUserIdCmd cmd) {
    return ResultResponse.success(gameFruitHistoryClientService.pageDaysUserData(cmd));
  }

}
