package com.red.circle.external.inner.endpoint.game;

import com.red.circle.external.inner.endpoint.baishun.api.BarrageGameClientApi;
import com.red.circle.external.inner.model.cmd.game.baishun.CloseRoomCmd;
import com.red.circle.external.inner.model.cmd.game.baishun.UserEffectsCmd;
import com.red.circle.external.inner.service.game.BarrageGameClientService;
import com.red.circle.framework.dto.ResultResponse;
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 lisizhe 2023/11/13  16:27
 */
@Validated
@RestController
@RequestMapping(value = BarrageGameClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class BarrageGameClientEndpoint implements BarrageGameClientApi {

    private final BarrageGameClientService barrageGameClientService;

    @Override
    public ResultResponse<Void> userEffects(UserEffectsCmd cmd) {
        barrageGameClientService.userEffects(cmd);
        return ResultResponse.success();
    }

    @Override
    public ResultResponse<Void> closeRoom(CloseRoomCmd cmd) {
        barrageGameClientService.closeRoom(cmd);
        return ResultResponse.success();
    }
}
