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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.live.LiveHeartbeatClientService;
import com.red.circle.other.inner.endpoint.live.api.LiveHeartbeatApi;
import com.red.circle.other.inner.model.cmd.live.LiveHeartbeatCmd;
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;

@Validated
@RestController
@RequestMapping(value = LiveHeartbeatApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class LiveHeartbeatClientEndpoint implements LiveHeartbeatApi{



  private final LiveHeartbeatClientService liveHeartbeatClientService;


  @Override
  public ResultResponse<Void> create(Long roomId,List<LiveHeartbeatCmd> qryCmd) {
    liveHeartbeatClientService.create(roomId,qryCmd);
    return ResultResponse.success();

  }

  @Override
  public ResultResponse<List<LiveHeartbeatCmd>> listLiveHeartbeat(Long roomId) {
    return ResultResponse.success(liveHeartbeatClientService.listLiveHeartbeat(roomId));
  }

}
