package com.red.circle.other.app.inner.service.material.props.impl;

import com.red.circle.other.app.inner.convertor.material.RoomThemeUserUserCustomizeInnerConvertor;
import com.red.circle.other.app.inner.service.material.props.RoomThemeCustomizeBackpackClientService;
import com.red.circle.other.infra.database.rds.service.props.RoomThemeUserCustomizeService;
import com.red.circle.other.inner.model.dto.material.RoomThemeUserCustomizeDTO;
import java.util.Map;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户房间主题背包(自定义) 服务类.
 *
 * @author pengliang on 2023/6/6
 */
@Service
@RequiredArgsConstructor
public class RoomThemeCustomizeBackpackClientServiceImpl implements
    RoomThemeCustomizeBackpackClientService {

  private final RoomThemeUserCustomizeService roomThemeUserCustomizeService;
  private final RoomThemeUserUserCustomizeInnerConvertor roomThemeUserUserCustomizeInnerConvertor;

  @Override
  public Map<Long, RoomThemeUserCustomizeDTO> mapByIds(Set<Long> ids) {
    return roomThemeUserUserCustomizeInnerConvertor.toMapRoomThemeUserUserCustomizeDTO(
        roomThemeUserCustomizeService.mapByIds(ids)
    );
  }

  @Override
  public RoomThemeUserCustomizeDTO getLatestCustomize(Long userId) {
    return roomThemeUserUserCustomizeInnerConvertor.toRoomThemeUserUserCustomizeDTO(
        roomThemeUserCustomizeService.getLatestCustomize(userId)
    );
  }

}
