package com.ruoyi.web.controller.system;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.HikcService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/hik")
public class HikcController extends BaseController {

    @Resource
    HikcService hikcService;

    @RequestMapping("/previewUrl")
    public AjaxResult previewUrl(SysDept dept){
        System.out.println("===================dept===============");
        System.out.println(dept.toString());

        if (StringUtils.isEmpty(dept.getCameraCode())
                || StringUtils.isEmpty(String.valueOf(dept.getPresetPoints()))){
            return AjaxResult.error();
        }

        return hikcService.previewUrl(dept);
    }

}
