package com.red.circle.external.inner.endpoint.message;

import com.red.circle.external.inner.endpoint.message.api.ImOperationClientApi;
import com.red.circle.external.inner.model.dto.OperationActiveIndexDTO;
import com.red.circle.external.inner.service.message.impl.ImOperationClientServiceImpl;
import com.red.circle.framework.dto.ResultResponse;
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;

/**
 * im 运营数据.
 *
 * @author pengliang on 2023/11/16
 */
@Validated
@RestController
@RequestMapping(value = ImOperationClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class ImOperationClientEndpoint implements ImOperationClientApi {

  private final ImOperationClientServiceImpl imOperationClientService;

  @Override
  public ResultResponse<List<OperationActiveIndexDTO>> getLatest30Days() {
    return ResultResponse.success(imOperationClientService.getLatest30Days());
  }
}
