package com.red.circle.external.inner.service.message.impl;

import com.red.circle.component.instant.msg.tencet.service.endpoint.api.im.operation.ImOperationManagerService;
import com.red.circle.external.inner.convertor.ImOperationInnerConvertor;
import com.red.circle.external.inner.model.dto.OperationActiveIndexDTO;
import com.red.circle.external.inner.service.message.ImOperationClientService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * im 运营数据.
 *
 * @author pengliang on 2023/11/16
 */
@Service
@RequiredArgsConstructor
public class ImOperationClientServiceImpl implements ImOperationClientService {

  private final ImOperationInnerConvertor imOperationInnerConvertor;
  private final ImOperationManagerService imOperationManagerService;

  @Override
  public List<OperationActiveIndexDTO> getLatest30Days() {
    return imOperationInnerConvertor.toListOperationActiveIndexDTO(
        imOperationManagerService.getLatest30Days().block().getResult());
  }

}
