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.GameRedPacketBackClientService;
import com.red.circle.other.inner.endpoint.game.api.GameRedPacketBackClientApi;
import com.red.circle.other.inner.model.cmd.game.GameRedPacketBackQryCmd;
import com.red.circle.other.inner.model.dto.game.GameRedPacketDTO;
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 zongpubin on 2024/1/27
 */
@Validated
@RestController
@RequestMapping(value = GameRedPacketBackClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GameRedPacketBackClientEndpoint implements GameRedPacketBackClientApi {

  private final GameRedPacketBackClientService gameRedPacketBackClientService;

  @Override
  public ResultResponse<List<GameRedPacketDTO>> listGameRedPacket(GameRedPacketBackQryCmd query) {
    return ResultResponse.success(gameRedPacketBackClientService.listGameRedPacket(query));
  }
}
