package com.ningdatech.carapi.open.controller;

import com.ningdatech.carapi.open.manage.AlarmDataManage;
import com.ningdatech.carapi.open.model.dto.AlarmDataPictureDTO;
import com.ningdatech.carapi.open.model.dto.AlarmDataVideoDTO;
import com.ningdatech.openapi.signature.annatation.OpenApiSignature;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @Classname AbnormalBehaviorAlarmDataController
 * @Description
 * @Date 2022/10/28 10:05
 * @Created by PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/alarm-data-save")
@Api(value = "AbnormalBehaviorAlarmData", tags = "保存异常行为数据")
@RequiredArgsConstructor
public class OpenApiAbnormalBehaviorAlarmDataController {

    private final AlarmDataManage alarmDataManage;

    @ApiOperation(value = "图片", notes = "图片")
    @PostMapping("/picture")
    @OpenApiSignature(expireCheck = false)
    public Boolean savePricture(@Valid @RequestBody AlarmDataPictureDTO alarmDataPicture) {
        return alarmDataManage.savePicture(alarmDataPicture);
    }

    @ApiOperation(value = "短视频", notes = "短视频")
    @PostMapping("/video")
    @OpenApiSignature(expireCheck = false)
    public Boolean saveVideo(@Valid @RequestBody AlarmDataVideoDTO alarmDataVideo) {
        return alarmDataManage.saveVideo(alarmDataVideo);
    }
}
