package com.project.zcustom.controller.service;

import com.project.common.core.controller.BaseController;
import com.project.common.core.domain.AjaxResult;
import com.project.zcustom.service.access.IPlatAccessService;
import com.project.zcustom.service.service.post.IPlatPostStationChartService;
import com.project.zcustom.service.service.post.IPlatPostStationService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 物业服务Controller
 *
 * @author change
 * @date 2024-10-21
 */

@RestController
@RequestMapping("/large/post")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlatPostStationController extends BaseController {

    private final IPlatPostStationService platPostStationService;
    private final IPlatPostStationChartService iPlatPostStationChartService;
    private final IPlatAccessService iPlatAccessService;


    @RequestMapping("/getOverviewData")
    public AjaxResult getOverviewData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", platPostStationService.getOverviewData(appOrg));
    }


    @RequestMapping("/getPastMonthPieData")
    public AjaxResult getPastMonthPieData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", platPostStationService.getPastMonthPieData(appOrg));
    }


    @RequestMapping("/getPastSixMonthChartsData")
    public AjaxResult getPastSixMonthChartsData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", iPlatPostStationChartService.getPastSixMonthChartsData(appOrg));
    }


    @RequestMapping("/getCarFlowData")
    public AjaxResult getCarFlowData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", iPlatAccessService.getCarFlowData(appOrg));
    }
}
