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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.material.gift.GiftCountAnchorDailyClientService;
import com.red.circle.other.inner.endpoint.material.gift.api.GiftCountAnchorDailyClientApi;
import com.red.circle.other.inner.model.dto.material.GiftCountAnchorDailyRunningWaterDTO;
import java.util.List;
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/8/18
 */
@Validated
@RestController
@RequestMapping(value = GiftCountAnchorDailyClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class GiftCountAnchorDailyClientEndpoint implements GiftCountAnchorDailyClientApi {

  private final GiftCountAnchorDailyClientService giftCountAnchorDailyClientService;

  @Override
  public ResultResponse<Void> deleteByTime(Long sendUserId, Integer startDateNumber,
      Integer endDateNumber) {
    giftCountAnchorDailyClientService.deleteByTime(sendUserId, startDateNumber, endDateNumber);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> removeByIds(List<String> ids) {
    giftCountAnchorDailyClientService.removeByIds(ids);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<List<GiftCountAnchorDailyRunningWaterDTO>> listThisMonth(Long userId) {
    return ResultResponse.success(giftCountAnchorDailyClientService.listThisMonth(userId));
  }

  @Override
  public ResultResponse<List<GiftCountAnchorDailyRunningWaterDTO>> listByMonthByAcceptAnchor(
      Long sendUserId,
      Integer startDateNumber, Integer endDateNumber) {
    return ResultResponse.success(
        giftCountAnchorDailyClientService.listByMonthByAcceptAnchor(sendUserId, startDateNumber,
            endDateNumber));
  }

}
