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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.game.GameTrumpetCountClientService;
import com.red.circle.other.inner.endpoint.game.api.GameTrumpetCountClientApi;
import com.red.circle.other.inner.model.cmd.game.GameTrumpetQryCmd;
import com.red.circle.other.inner.model.dto.game.GameTrumpetCountDTO;
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;

/**
 * 喇叭.
 *
 * @author pengliang on 2023/12/23
 */
@Validated
@RestController
@RequestMapping(value = GameTrumpetCountClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GameTrumpetCountClientEndpoint implements GameTrumpetCountClientApi {

  private final GameTrumpetCountClientService gameTrumpetCountClientService;

  @Override
  public ResultResponse<List<GameTrumpetCountDTO>> opsList(GameTrumpetQryCmd query) {
    return ResultResponse.success(
        gameTrumpetCountClientService.opsList(query)
    );
  }

  @Override
  public ResultResponse<Void> delete(Long id, Long updateUser) {
    gameTrumpetCountClientService.delete(id, updateUser);
    return ResultResponse.success();
  }
}
