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.PropsActivityRewardConfigClientService;
import com.red.circle.other.inner.endpoint.material.props.api.PropsActivityRewardConfigClientApi;
import com.red.circle.other.inner.model.dto.material.PropsActivityRewardConfigInfoDTO;
import java.util.List;
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 zongpubin on 2023/10/11
 */
@Validated
@RestController
@RequestMapping(value = PropsActivityRewardConfigClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class PropsActivityRewardConfigClientEndpoint implements PropsActivityRewardConfigClientApi {

  private final PropsActivityRewardConfigClientService propsActivityRewardConfigClientService;

  @Override
  public ResultResponse<Map<Long, List<PropsActivityRewardConfigInfoDTO>>> mapByGroupIds(
      Set<Long> sourceGroupIds) {
    return ResultResponse.success(
        propsActivityRewardConfigClientService.mapByGroupIds(sourceGroupIds));
  }
}
