package cn.iocoder.yudao.module.system.controller.admin.hik;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.service.hik.HikService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

/**
 * 工厂管理-工厂列表
 *
 * @author qun.xu
 */
@RestController
@RequestMapping("/system/smartfactory/hik")
@Tag(name = "海康接口")
public class HikController {

    @Resource
    private HikService hikService;

    @GetMapping("/getCameraUrl")
    @Operation(summary = "视频播放->查询播放地址")
//    @PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
    @PermitAll
    public CommonResult<String> getCameraUrl(String cameraCode) {
        String url = hikService.getPreviewUrlsApi(cameraCode, 0);
        return CommonResult.success(url);
    }

}
