package com.fastbee.deviceData.api.renke.constant;

import com.alibaba.fastjson.JSONObject;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.config.RuoYiConfig;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.core.page.TableDataInfo;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.model.bto.DoorAlertBto;
import com.fastbee.common.utils.RotateImageUtils;
import com.fastbee.common.utils.file.FileUploadUtils;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.deviceData.api.renke.domin.*;
import com.fastbee.deviceData.api.renke.service.RenKeAuthorizationService;
import com.fastbee.deviceData.api.renke.service.RenKeUserDeviceOverview;
import com.fastbee.deviceData.api.renke.service.RenkeMetDeviceService;
import com.fastbee.deviceData.api.renke.service.RenkeWormSituationDeviceService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;

import static com.fastbee.common.utils.StringUtils.isEmpty;

/**
 * 设备告警上传Controller
 *
 * @author Dunxi Zang
 * @date 2024-06-19
 */
@RestController
@RequestMapping("/iot/photos")
@Api(tags = "安防小板")
public class test extends BaseController {
    @Autowired
    private RenkeWormSituationDeviceService renkeWormSituationDeviceService;
    @Autowired
    private RenkeMetDeviceService renkeMetDeviceService;

    @Autowired
    private RenKeUserDeviceOverview renKeUserDeviceOverview;

    /**
     * 查询设备告警上传列表
     */

    @GetMapping("/test")
    public Object list() {
        RenkeWormSituationDeviceService service = new RenkeWormSituationDeviceService();
        String deviceAddr= "1017240042";
        String groupId = "1";
        String recordIds = "1";
        String beginTime = "2024-10-30 10:00:00",
                endTime = "2024-11-12 10:00:00";
        Integer pages = 1;
        Integer limit = 1;
        String nodeId = "1";
        String enable = "1";
      return  renKeUserDeviceOverview.getsysAllUserDevice();
//        return renkeMetDeviceService.getWormDataList(deviceAddr,nodeId,beginTime,endTime,pages,limit);
    }
    @PostMapping("/testJosn")
    public Object testJosn(@RequestBody UpdateNodeInfo json) {


        String token = "91191731304831841";
        return renkeMetDeviceService.updateNodeInfo(json);
    }

}
