package com.ruoyi.web.controller.doumu;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IDoumuProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/statistics")
public class StatisticsController {

    @Autowired
    private IDoumuProductInfoService doumuProductInfoService;

    /**
     * pc首页各环节数量统计
     * dateType 1：当天，2：本周，3：本月，4：当前季度，5：年度
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:link')")
    @GetMapping(value = "/link")
    public AjaxResult link(String dateType)
    {
        return doumuProductInfoService.link(dateType);
    }

    /**
     * pc首页本月各环节进度情况
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:monthLink')")
    @GetMapping(value = "/monthLink")
    public AjaxResult monthLink()
    {
        return doumuProductInfoService.monthLink();
    }

    /**
     * pc首页作品数量与销售金额统计
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:numAmount')")
    @GetMapping(value = "/numAmount")
    public AjaxResult numAmount()
    {
        return doumuProductInfoService.numAmount();
    }

    /**
     * pc首页本周关注目标
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:weekFollow')")
    @GetMapping(value = "/weekFollow")
    public AjaxResult weekFollow()
    {
        return doumuProductInfoService.weekFollow();
    }

    /**
     * pc首页订单评价统计
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:evaluate')")
    @GetMapping(value = "/evaluate")
    public AjaxResult evaluate()
    {
        return doumuProductInfoService.evaluate();
    }

    /**
     * app首页销售额统计
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:sales')")
    @GetMapping(value = "/app/sales")
    public AjaxResult sales()
    {
        return doumuProductInfoService.sales();
    }

    /**
     * app首页作品数量统计
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:numberWorks')")
    @GetMapping(value = "/app/numberWorks")
    public AjaxResult numberWorks()
    {
        return doumuProductInfoService.numberWorks();
    }

    /**
     * app首页好评率统计
     * dateType 1：当天，2：本周，3：本月，4：当前季度，5：年度
     */
    @PreAuthorize("@ss.hasPermi('system:statistics:reputation')")
    @GetMapping(value = "/app/reputation")
    public AjaxResult reputation(String dateType)
    {
        return doumuProductInfoService.reputation(dateType);
    }


}
