package com.yuchen.saas.park.service.controller.face;

import com.yuchen.saas.park.service.util.VideoEventsUtils;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 刘通
 * @version 1.0
 * @date 2021/3/27 17:37
 */
@RestController
@AllArgsConstructor
@RequestMapping("/personVideoEvents")
@Api(value = "人员和视频事件", tags = "人员和视频事件")
public class PersonVideoEventsController {
	@Autowired
	private VideoEventsUtils videoEventsUtils;


	@GetMapping("/getPersonVideoEvents")
	public R<Object> findMonitorData(@RequestParam String parkId) {
		Object data = videoEventsUtils.findMonitorData(parkId);
		return R.data(data);
	}

	@PostMapping("/savePersonVideoEvents")
	public void savePersonVideoEvents(@RequestParam  Map<String, Object> mongoCommonData, @RequestParam String parkId) {
		videoEventsUtils.savePersonVideoEvents(mongoCommonData, parkId);
	}
}
