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

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.RoomTopFixedCmd;
import com.red.circle.other.inner.model.cmd.sys.RoomTopFixedQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysTopRoomDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author pengliang on 2022/11/16
 */
@Service
@RequiredArgsConstructor
public class RoomTopFixedBackServiceImpl implements RoomTopFixedBackService {

  private final HotRoomClient hotRoomClient;

  @Override
  public void addOrUpdate(RoomTopFixedCmd param) {
    ResponseAssert.requiredSuccess(hotRoomClient.addOrUpdateRoomTop(param));
  }

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

  @Override
  public PageResult<SysTopRoomDTO> pageRoom(RoomTopFixedQryCmd query) {
    return ResponseAssert.requiredSuccess(hotRoomClient.listRoomTop(query));
  }
}
