package com.red.circle.other.app.inner.endpoint.user.count;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.user.count.CountUserActiveIndexClientService;
import com.red.circle.other.inner.endpoint.user.count.api.CountUserActiveIndexClientApi;
import com.red.circle.other.inner.endpoint.user.pet.api.PetClientApi;
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/16
 */
@Validated
@RestController
@RequestMapping(value = CountUserActiveIndexClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class CountUserActiveIndexClientEndpoint implements CountUserActiveIndexClientApi {

  private final CountUserActiveIndexClientService countUserActiveIndexClientService;

  @Override
  public ResultResponse<Long> getActiveAnchorCount(String date) {
    return ResultResponse.success(countUserActiveIndexClientService.getActiveAnchorCount(date));
  }

  @Override
  public ResultResponse<Long> getActiveOrdinaryCount(String date) {
    return ResultResponse.success(countUserActiveIndexClientService.getActiveOrdinaryCount(date));
  }

}
