package com.fs.watch.controller;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.watch.domain.WatchDeviceInfoClic;
import com.fs.watch.param.DeviceIdAndIotInfoQueryParam;
import com.fs.watch.service.WatchDeviceInfoClicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/watch/deviceInfo")
public class WatchDeviceInfoClicController extends BaseController {

    @Autowired
    private WatchDeviceInfoClicService watchDeviceInfoClicService;

    @PostMapping("/insert")
    public AjaxResult insertDeviceInfo(@RequestBody WatchDeviceInfoClic data){
        return AjaxResult.success(watchDeviceInfoClicService.insert(data));
    }

    @GetMapping("/query")
//    @PreAuthorize("@ss.hasPermi('watchApi:iot:list')")
    public TableDataInfo getDeviceIdAndIotInfo(DeviceIdAndIotInfoQueryParam param){
        startPage();
        return watchDeviceInfoClicService.getDeviceIdAndIotInfo(param);
    }
}
