package com.wzj.soopin.statistics.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wzj.soopin.order.domain.vo.PageVO;
import com.wzj.soopin.statistics.entity.dto.StatisticsQueryParam;
import com.wzj.soopin.statistics.entity.vo.RefundOrderStatisticsDataVO;
import com.wzj.soopin.statistics.service.RefundOrderStatisticsService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.dromara.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 管理端,退款统计接口
 *
 * @author Bulbasaur
 * @since 2020/12/9 19:04
 */
@Tag(name = "管理端,退款统计接口")
@RestController
@RequestMapping("/manager/statistics/refundOrder")
public class RefundOrderStatisticsManagerController {
    @Autowired
    private RefundOrderStatisticsService refundOrderStatisticsService;

    @Operation(summary = "获取退款统计列表")
    @GetMapping("/getByPage")
    public R<IPage<RefundOrderStatisticsDataVO>> getByPage(PageVO pageVO, StatisticsQueryParam statisticsQueryParam) {
        return R.ok(refundOrderStatisticsService.getRefundOrderStatisticsData(pageVO, statisticsQueryParam));
    }

    @Operation(summary = "获取退款统计金额")
    @GetMapping("/getPrice")
    public R<Object> getPrice(StatisticsQueryParam statisticsQueryParam) {
        return R.ok(refundOrderStatisticsService.getRefundOrderStatisticsPrice(statisticsQueryParam));
    }
}
