package com.ruoyi.web.dashboard;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dashboard.domain.revenueStat.RevenueStatQuery;
import com.ruoyi.bst.store.service.StoreValidator;
import com.ruoyi.dashboard.service.DashboardService;
import io.swagger.annotations.ApiOperation;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wjh
 * 2024/10/8
 */
@RestController
@RequestMapping("/dashboard")
public class DashboardController extends BaseController {

    @Autowired
    private DashboardService dashboardService;

    @ApiOperation("获取营收统计")
    @PreAuthorize("@ss.hasAnyPermi('dashboard:revenue')")
    @GetMapping("/revenueStat")
    public AjaxResult getRevenueStat(RevenueStatQuery query) {
        query.setScope(true);
        return success(dashboardService.selectRevenueStat(query));
    }


}
