package com.bonus.canteen.core.kitchen.controller;

import com.bonus.canteen.core.kitchen.entity.dto.PassengerFlowQueryDTO;
import com.bonus.canteen.core.kitchen.service.DevicePassengerFlowService;
import com.bonus.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping({"/api/v1/camera"})
@Api(
   value = "人流检测仪管理",
   tags = {"人流检测管理"}
)
public class DeviceCameraController {
   @Generated
   private static final Logger log = LoggerFactory.getLogger(DeviceCameraController.class);
   @Autowired
   DevicePassengerFlowService devicePassengerFlowService;

   @ApiOperation("统计时段内客流人数(包含进入、离开)")
   @PostMapping({"/queryPassengerNum"})
   public AjaxResult queryPassengerNum(@RequestBody PassengerFlowQueryDTO content) {
      return AjaxResult.success(this.devicePassengerFlowService.queryPassengerNum(content));
   }

   @ApiOperation("查询当前食堂的在场人数及食堂信息")
   @GetMapping({"/queryNowPresentNum"})
   public AjaxResult queryNowPerson() {
      return AjaxResult.success(this.devicePassengerFlowService.queryAllAllocCanteenPresentFlow());
   }
}
