package easydo.technology.controller;

import easydo.technology.model.vo.SalePerformanceVO;
import easydo.technology.service.SalePerformanceService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/salePerformance")
public class SalePerformanceController {

    @Resource
    private SalePerformanceService salePerformanceService;

    @RequestMapping(value = "/getTotalPrice")
    public Object getTotalPrice(@RequestBody Map<String, Object> map) throws Exception {
        SalePerformanceVO result = salePerformanceService.getTotalPrice(map);
        return new ResponseEntity<>(result, HttpStatus.OK);
    }

    @RequestMapping(value = "/getEcharts")
    public Object getEcharts(@RequestBody Map<String, Object> map) throws Exception {
        SalePerformanceVO result = salePerformanceService.getEcharts(map);
        return new ResponseEntity<>(result, HttpStatus.OK);
    }
}

