package com.red.circle.order.inner.endpoint;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.order.inner.endpoint.api.OrderPurchaseFriendshipRecordClientApi;
import com.red.circle.order.inner.model.dto.OrderPurchaseFriendshipRecordDTO;
import com.red.circle.order.inner.service.OrderPurchaseFriendshipRecordClientService;
import java.util.List;
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/11/3
 */
@Validated
@RestController
@RequestMapping(value = OrderPurchaseFriendshipRecordClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class OrderPurchaseFriendshipRecordClientEndpoint implements
    OrderPurchaseFriendshipRecordClientApi {

  private final OrderPurchaseFriendshipRecordClientService orderPurchaseFriendshipRecordClientService;

  @Override
  public ResultResponse<List<OrderPurchaseFriendshipRecordDTO>> listByOrderIds(Set<Long> orderIds) {
    return ResultResponse.success(
        orderPurchaseFriendshipRecordClientService.listByOrderIds(orderIds));
  }

}
