package com.fs.watch.controller;

import com.fs.common.core.domain.AjaxResult;
import com.fs.watch.domain.WatchDeviceData;
import com.fs.watch.service.WatchDeviceDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/watch/device/data")
public class WatchDeviceDataController {
    @Autowired
    private WatchDeviceDataService watchDeviceDataService;

    @PostMapping("/insert")
    public AjaxResult insertDeviceData(@RequestBody WatchDeviceData data){
        return AjaxResult.success(watchDeviceDataService.insert(data));
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody WatchDeviceData data){
        return AjaxResult.success(watchDeviceDataService.updateByDeviceId(data));
    }
}
