package com.izouma.jiashanxia.web;

import com.izouma.jiashanxia.dto.StatisticDTO;
import com.izouma.jiashanxia.service.StatisticService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@AllArgsConstructor
@RestController
@RequestMapping("/statistic")
public class StatisticController {
    private StatisticService statisticService;

    @ApiOperation("数据总浏")
    @GetMapping("/data")
    public Map<String, Object> dataOverview() {
        return statisticService.dataOverview();
    }

    @ApiOperation("日销售额")
    @GetMapping("/dayAdd")
    public List<StatisticDTO> dayAdd(Integer day) {
        return statisticService.dayData(day);
    }
}
