package com.yuchen.saas.integration.feign.api.feign;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceAddDTO;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceDeleteDTO;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceUpdateDTO;
import com.yuchen.saas.integration.hik.isc.vo.CameraDeviceInfoVO;
import com.yuchen.saas.integration.hik.isc.vo.XgVideoVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

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

/**
 *
 * @author
 * @create
 */
@FeignClient(
        value = AppNameConstant.SAAS_INTEGRATION_HIK_ISC,
        fallbackFactory = PmgBatCameraDeviceInfoFeignFallback.class
)
public interface PmgBatCameraDeviceInfoFeign {

    /**
     * 摄像头同步添加
     *
     * @param dto
     * @return
     */
    @PostMapping("/camera/device/sync/add")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "设备添加/批量添加", notes = "设备添加/批量添加")
    public R<Boolean> add(@Valid @RequestBody List<CameraDeviceAddDTO> dto);

    /**
     * 摄像头同步修改
     *
     * @param dto
     * @return
     */
    @PostMapping("/camera/device/sync/update")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "设备添修改", notes = "设备添加/批量添加")
    public R<Boolean> update(@Valid @RequestBody CameraDeviceUpdateDTO dto);

    /**
     * 摄像头同步删除
     *
     * @param dto
     * @return
     */
    @DeleteMapping("/camera/device/sync/delete")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "设备删除", notes = "设备删除")
    public R<Boolean> delete(@RequestBody @ApiParam("设备id的集合") @Valid CameraDeviceDeleteDTO dto);

    /**
     * 摄像头详情
     *
     * @param id
     * @return
     */
    @GetMapping("/camera/device/sync/info/{id}")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "设备详情", notes = "设备详情")
    public R<CameraDeviceInfoVO> info(@PathVariable Long id);


    /**
     * 获取播放url
     *
     * @param id
     * @return
     */
    @GetMapping("/camera/device/getVideoUrl/{id}")
    @ApiOperationSupport(order = 11)
    @ApiOperation(value = "获取播放url", notes = "获取播放url")
    public R<XgVideoVO> getVideoUrl(@PathVariable(value = "id") Long id) ;

}
