package com.red.circle.other.app.inner.service.live.impl;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.app.inner.convertor.live.RoomProfileInnerConvertor;
import com.red.circle.other.app.inner.service.live.RoomMikeTypeClientService;
import com.red.circle.other.infra.database.rds.service.live.RoomMikeTypeService;
import com.red.circle.other.infra.database.rds.service.sys.MikeTypeConfigService;
import com.red.circle.other.inner.model.cmd.live.MikeTypePropsQryCmd;
import com.red.circle.other.inner.model.dto.live.RoomMikeTypeDTO;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author pengliang on 2020/12/11
 */
@Service
@RequiredArgsConstructor
public class RoomMikeTypeClientServiceImpl implements RoomMikeTypeClientService {

  private final RoomMikeTypeService roomMikeTypeService;
  private final MikeTypeConfigService mikeTypeConfigService;
  private final RoomProfileInnerConvertor roomProfileInnerConvertor;

  @Override
  public PageResult<RoomMikeTypeDTO> pageRoomMikeTypeList(MikeTypePropsQryCmd query) {
    return roomMikeTypeService.pageRoomMikeTypeList(query)
        .convert(roomProfileInnerConvertor::toRoomMikeTypeDTO);
  }

  @Override
  public Map<String, String> getMikeTypeByType(String sysOrigin) {
    return mikeTypeConfigService.getMikeTypeByType(sysOrigin);
  }
}
