package com.project.zcustom.controller.engineering;


import com.project.zcustom.controller.core.AjaxResult;
import com.project.zcustom.controller.core.BaseController;
import com.project.zcustom.service.service.basics.IPlatAppOrgService;
import com.project.zcustom.service.unit.ILargeCameraService;
import com.project.zcustom.service.unit.ILargeProjectService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

    private final IPlatAppOrgService platAppOrgService;

    private final ILargeProjectService largeProjectService;

    private final ILargeCameraService largeCameraService;

    /**
     * 各单位已接入项目数量和已接入摄像头数量
     */
    @GetMapping("/getProjectCameraNumList/{appOrg}")
    public AjaxResult getProjectCameraNumList(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", platAppOrgService.getProjectCameraNumList(appOrg));
    }

    /**
     * 各项目已接入摄像头数量
     */
    @GetMapping("/getCameraNumList/{appOrg}")
    public AjaxResult getCameraNumList(@PathVariable String appOrg) {
        return AjaxResult.success("查询成功", largeProjectService.getCameraNumList(appOrg));
    }

    /**
     * 某项目的所有摄像头信息
     */
    @GetMapping("/getCameraList/{projectId}")
    public AjaxResult getCameraList(@PathVariable Long projectId) {
        return AjaxResult.success("查询成功", largeCameraService.getCameraList(projectId));
    }
}
