package com.red.circle.console.adapter.app.game;

import com.red.circle.console.app.dto.clienobject.game.GameLudoHistoryCO;
import com.red.circle.console.app.service.app.game.GameLudoService;
import com.red.circle.console.infra.annotations.OpsOperationReqLog;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.game.GameLudoQryCmd;
import java.util.List;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 飞行棋.
 *
 * @author pengliang on 2022/5/7
 */
@AllArgsConstructor
@RestController
@RequestMapping("/game-ludo")
public class GameLudoRestController extends BaseController {

  private final GameLudoService ludoService;

  @GetMapping("/flow")
  public List<GameLudoHistoryCO> listGame(GameLudoQryCmd query) {
    return ludoService.listGame(query);
  }

  @OpsOperationReqLog("解散Ludo游戏")
  @GetMapping("/dismiss")
  public void dismiss(@RequestParam Long roomId) {
    ludoService.dismiss(roomId);
  }

}
