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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.order.inner.endpoint.api.MonthlyRechargeUserClientApi;
import com.red.circle.order.inner.model.cmd.MonthlyRechargePageTableQry;
import com.red.circle.order.inner.model.cmd.QualityUserMonthlyPageTableQry;
import com.red.circle.order.inner.model.dto.MonthlyRechargeUserDTO;
import com.red.circle.order.inner.service.MonthlyRechargeUserClientService;
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 2024/1/23
 */
@Validated
@RestController
@RequestMapping(value = MonthlyRechargeUserClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class MonthlyRechargeUserClientEndpoint implements MonthlyRechargeUserClientApi {

  private final MonthlyRechargeUserClientService monthlyRechargeUserClientService;

  @Override
  public ResultResponse<PageResult<MonthlyRechargeUserDTO>> opsPageQuery(
      QualityUserMonthlyPageTableQry qry) {
    return ResultResponse.success(monthlyRechargeUserClientService.opsPageQuery(qry));
  }

  @Override
  public ResultResponse<PageResult<MonthlyRechargeUserDTO>> opsPageMonthlyQuery(
      MonthlyRechargePageTableQry qry) {
    return ResultResponse.success(
        monthlyRechargeUserClientService.opsPageMonthlyQuery(qry)
    );
  }

}
