package com.red.circle.other.app.inner.endpoint.game;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.game.GameLuckyBoxClientService;
import com.red.circle.other.inner.endpoint.game.api.GameLuckyClientApi;
import com.red.circle.other.inner.model.cmd.game.GameLuckBoxAwardConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckBoxBountyConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckBoxFortuneValueConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckBoxStandardConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckyBoxAwardDetailsConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckyBoxBountyDetailsConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.GameLuckyBoxStandardDetailsConfigQryCmd;
import com.red.circle.other.inner.model.cmd.game.LuckBoxGameQryCmd;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxAwardConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxAwardDetailsConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxBountyConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxBountyDetailsConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxCountDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxCountInfoDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxFortuneValueConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxGiftConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxStandardConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxStandardDetailsConfigDTO;
import com.red.circle.other.inner.model.dto.game.GameLuckyBoxTimeConfigDTO;
import com.red.circle.other.inner.model.dto.game.LuckyBoxGiftMapDTO;
import java.util.List;
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;

/**
 * 游戏lucky服务.
 *
 * @author lisizhe on 2023/11/10
 */
@Validated
@RestController
@RequestMapping(value = GameLuckyClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GameLuckyClientEndpoint implements GameLuckyClientApi {

  private final GameLuckyBoxClientService gameLuckyBoxClientService;


  @Override
  public ResultResponse<PageResult<GameLuckyBoxCountDTO>> pageLuckyBoxGameRecord(
      LuckBoxGameQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.pageLuckyBoxGameRecord(query));
  }

  @Override
  public ResultResponse<GameLuckyBoxCountInfoDTO> countLuckyBoxGame(LuckBoxGameQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.countLuckyBoxGame(query));
  }


  @Override
  public ResultResponse<GameLuckyBoxFortuneValueConfigDTO> getLuckyBoxFortuneValueConfig(
      GameLuckBoxFortuneValueConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.getLuckyBoxFortuneValueConfig(query));
  }


  @Override
  public ResultResponse<Void> addLuckyBoxFortuneValueConfig(
      GameLuckyBoxFortuneValueConfigDTO param) {
    gameLuckyBoxClientService.addLuckyBoxFortuneValueConfig(param);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<PageResult<GameLuckyBoxBountyConfigDTO>> pageBountyConfig(
      GameLuckBoxBountyConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.pageBountyConfig(query));
  }


  @Override
  public ResultResponse<Void> addGameLuckyBoxBountyConfig(GameLuckyBoxBountyConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxBountyConfig(param);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<Void> deleteBountyConfig(Long id) {
    gameLuckyBoxClientService.deleteBountyConfig(id);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<List<GameLuckyBoxBountyDetailsConfigDTO>> getGameLuckyBoxBountyDetailsConfig(
      GameLuckyBoxBountyDetailsConfigQryCmd query) {
    return ResultResponse.success(
        gameLuckyBoxClientService.getGameLuckyBoxBountyDetailsConfig(query));
  }

  @Override
  public ResultResponse<Void> addGameLuckyBoxBountyDetailsConfig(
      GameLuckyBoxBountyDetailsConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxBountyDetailsConfig(param);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<Void> deleteBountyDetailsConfig(Long id) {
    gameLuckyBoxClientService.deleteBountyDetailsConfig(id);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<PageResult<GameLuckyBoxAwardConfigDTO>> pageAwardConfig(
      GameLuckBoxAwardConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.pageAwardConfig(query));
  }


  @Override
  public ResultResponse<Void> addGameLuckyBoxAwardConfig(GameLuckyBoxAwardConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxAwardConfig(param);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<Void> deleteAwardConfig(Long id) {
    gameLuckyBoxClientService.deleteAwardConfig(id);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<List<GameLuckyBoxAwardDetailsConfigDTO>> listGameLuckyBoxAwardDetailsConfig(
      GameLuckyBoxAwardDetailsConfigQryCmd query) {
    return ResultResponse.success(
        gameLuckyBoxClientService.listGameLuckyBoxAwardDetailsConfig(query));
  }

  @Override
  public ResultResponse<Void> addGameLuckyBoxAwardDetailsConfig(
      GameLuckyBoxAwardDetailsConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxAwardDetailsConfig(param);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> deleteAwardDetailsConfig(Long id) {
    gameLuckyBoxClientService.deleteAwardDetailsConfig(id);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<PageResult<GameLuckyBoxStandardConfigDTO>> pageStandardConfig(
      GameLuckBoxStandardConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.pageStandardConfig(query));
  }


  @Override
  public ResultResponse<Void> addStandardConfig(GameLuckyBoxStandardConfigDTO param) {
    gameLuckyBoxClientService.addStandardConfig(param);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<Void> switchStatus(Long id, Boolean status) {
    gameLuckyBoxClientService.switchStatus(id, status);
    return ResultResponse.success();
  }


  @Override
  public ResultResponse<Void> deleteStandardConfig(Long id) {
    gameLuckyBoxClientService.deleteStandardConfig(id);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<List<GameLuckyBoxTimeConfigDTO>> getGameLuckyBoxStandardDetailsConfig(
      GameLuckyBoxStandardDetailsConfigQryCmd query) {
    return ResultResponse.success(
        gameLuckyBoxClientService.getGameLuckyBoxStandardDetailsConfig(query));
  }


  @Override
  public ResultResponse<List<GameLuckyBoxGiftConfigDTO>> getGameLuckyBoxGiftConfig(
      GameLuckyBoxStandardDetailsConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.getGameLuckyBoxGiftConfig(query));
  }


  @Override
  public ResultResponse<List<LuckyBoxGiftMapDTO>> mapLuckyBoxGiftMap(
      GameLuckyBoxStandardDetailsConfigQryCmd query) {
    return ResultResponse.success(gameLuckyBoxClientService.mapLuckyBoxGiftMap(query));
  }

  @Override
  public ResultResponse<Void> addGameLuckyBoxGiftConfig(GameLuckyBoxGiftConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxGiftConfig(param);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> addGameLuckyBoxStandardDetailsConfig(
      GameLuckyBoxStandardDetailsConfigDTO param) {
    gameLuckyBoxClientService.addGameLuckyBoxStandardDetailsConfig(param);
    return ResultResponse.success();
  }
}
