// 使用模拟服务代替真实请求
import mockService from '@/api/mock/parking-mock-service'

// 获取停车场统计数据
export function getParkingStatistics() {
    return mockService.getParkingStatistics()
}

// 获取实时监控数据
export function getRealtimeData() {
    return mockService.getRealtimeData()
}

// 获取停车场报表数据
export function getParkingReport(params) {
    return mockService.getParkingReport(params)
}

// 获取楼层车位分布
export function getFloorDistribution(buildingId) {
    return request({
        url: '/parking/monitor/distribution/' + buildingId,
        method: 'get'
    })
}

// 获取最近入场记录
export function getRecentEntries(limit = 10) {
    return request({
        url: '/parking/monitor/entries',
        method: 'get',
        params: { limit }
    })
}

// 获取最近出场记录
export function getRecentExits(limit = 10) {
    return request({
        url: '/parking/monitor/exits',
        method: 'get',
        params: { limit }
    })
}

// 获取车位占用率趋势
export function getOccupancyTrend(params) {
    return request({
        url: '/parking/monitor/occupancy-trend',
        method: 'get',
        params: params
    })
}

// 获取收入趋势
export function getRevenueTrend(params) {
    return request({
        url: '/parking/monitor/revenue-trend',
        method: 'get',
        params: params
    })
}

// 导出报表
export function exportReport(params) {
    return request({
        url: '/parking/monitor/report/export',
        method: 'get',
        params: params,
        responseType: 'blob'
    })
}

// 获取异常车位列表
export function getAbnormalSpaces() {
    return request({
        url: '/parking/monitor/abnormal',
        method: 'get'
    })
}

// 获取长时停车列表
export function getLongTermParking(hours = 24) {
    return request({
        url: '/parking/monitor/long-term',
        method: 'get',
        params: { hours }
    })
}

// 获取车位使用热力图数据
export function getHeatmapData(params) {
    return request({
        url: '/parking/monitor/heatmap',
        method: 'get',
        params: params
    })
}

// 获取高峰时段分析
export function getPeakAnalysis(params) {
    return request({
        url: '/parking/monitor/peak-analysis',
        method: 'get',
        params: params
    })
}

// 获取车位周转率
export function getTurnoverRate(params) {
    return request({
        url: '/parking/monitor/turnover-rate',
        method: 'get',
        params: params
    })
}

// 获取实时告警信息
export function getRealtimeAlerts() {
    return request({
        url: '/parking/monitor/alerts',
        method: 'get'
    })
}

// WebSocket连接配置
export function getWebSocketConfig() {
    return request({
        url: '/parking/monitor/ws-config',
        method: 'get'
    })
}










export function getRealtimePatrol() {
    return request({
        url: '/patrol/monitor/realtime',
        method: 'get'
    })
}

// 获取巡更路线数据
export function getPatrolRoute(routeId) {
    return request({
        url: '/patrol/monitor/route/' + routeId,
        method: 'get'
    })
}

// 获取摄像头视频流
export function getCameraStream(cameraId) {
    return request({
        url: '/patrol/monitor/camera/' + cameraId,
        method: 'get'
    })
}