package com.usky.sas.controller.web;

import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.sas.service.SasIntelligentService;
import com.usky.sas.service.vo.IntelligentEventItem;
import com.usky.sas.service.vo.IntelligentEventPageRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 智能分析接口
 *
 * GET /prod-api/service-sas/intelligent/events
 * GET /prod-api/service-sas/intelligent/snap
 * GET /prod-api/service-sas/intelligent/alarm
 * GET /prod-api/service-sas/intelligent/entrance
 * GET /prod-api/service-sas/intelligent/parking
 * GET /prod-api/service-sas/intelligent/patrol
 */
@RestController
@RequestMapping("/intelligent")
public class SasIntelligentController {

    @Autowired
    private SasIntelligentService sasIntelligentService;

    @GetMapping("/events")
    public ApiResult<CommonPage<IntelligentEventItem>> events(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.queryEvents(request));
    }

    @GetMapping("/snap")
    public ApiResult<CommonPage<IntelligentEventItem>> snap(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.querySnap(request));
    }

    @GetMapping("/alarm")
    public ApiResult<CommonPage<IntelligentEventItem>> alarm(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.queryAlarm(request));
    }

    @GetMapping("/entrance")
    public ApiResult<CommonPage<IntelligentEventItem>> entrance(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.queryEntrance(request));
    }

    @GetMapping("/parking")
    public ApiResult<CommonPage<IntelligentEventItem>> parking(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.queryParking(request));
    }

    @GetMapping("/patrol")
    public ApiResult<CommonPage<IntelligentEventItem>> patrol(IntelligentEventPageRequest request) {
        return ApiResult.success(sasIntelligentService.queryPatrol(request));
    }
}

