package com.red.circle.console.app.service.app.sys;

import com.red.circle.common.business.dto.cmd.PageRoomIdCmd;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.inner.endpoint.live.HotRoomClient;
import com.red.circle.other.inner.model.cmd.sys.SysHotRoomCmd;
import com.red.circle.other.inner.model.dto.sys.SysHotRoomDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 设置热门房间.
 *
 * @author pengshigang on 2022/5/6
 */
@Service
@RequiredArgsConstructor
public class SetHotRoomServiceImpl implements SetHotRoomService {

  private final HotRoomClient hotRoomClient;

  @Override
  public void addOrUpdate(SysHotRoomCmd param) {
    hotRoomClient.addOrUpdate(param);
  }

  @Override
  public void remove(Long roomId) {
    hotRoomClient.remove(roomId);
  }

  @Override
  public PageResult<SysHotRoomDTO> pageRoom(PageRoomIdCmd cmd) {
    return ResponseAssert.requiredSuccess(hotRoomClient.pageRoom(cmd));
  }
}
