package com.red.circle.other.app.inner.endpoint.material.props;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.material.props.RoomThemeCustomizeBackpackClientService;
import com.red.circle.other.inner.endpoint.material.props.api.RoomThemeCustomizeBackpackClientApi;
import com.red.circle.other.inner.model.dto.material.RoomThemeUserCustomizeDTO;
import java.util.Map;
import java.util.Set;
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;

/**
 * 用户房间主题背包(自定义) 服务类.
 *
 * @author pengliang on 2023/6/6
 */
@Validated
@RestController
@RequestMapping(value = RoomThemeCustomizeBackpackClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class RoomThemeCustomizeBackpackClientEndpoint implements
    RoomThemeCustomizeBackpackClientApi {

  private final RoomThemeCustomizeBackpackClientService roomThemeCustomizeBackpackClientService;

  @Override
  public ResultResponse<Map<Long, RoomThemeUserCustomizeDTO>> mapByIds(Set<Long> ids) {
    return ResultResponse.success(roomThemeCustomizeBackpackClientService.mapByIds(ids));
  }

  @Override
  public ResultResponse<RoomThemeUserCustomizeDTO> getLatestCustomize(Long userId) {
    return ResultResponse.success(
        roomThemeCustomizeBackpackClientService.getLatestCustomize(userId));
  }
}
