package com.fs.watch.controller;

import com.fs.common.core.domain.AjaxResult;
import com.fs.watch.domain.WatchThirdUaData;
import com.fs.watch.service.WatchThirdUaDataService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 三方尿酸(WatchThirdUaData)表控制层
 *
 * @author makejava
 * @since 2024-08-20 09:26:32
 */
@RestController
@RequestMapping("/watch/third/ua")
public class WatchThirdUaDataController {
    /**
     * 服务对象
     */
    @Resource
    private WatchThirdUaDataService watchThirdUaDataService;

    @PostMapping("/insert")
    public AjaxResult insertThirdUaData(@RequestBody WatchThirdUaData data){
        return AjaxResult.success(watchThirdUaDataService.insert(data));
    }

    /**
     * 查询某天的数据
     * @param  date 日期
     * @param  deviceId 主键
     * @return 某天的数据
     */
    @GetMapping("/queryByDateAndDeviceId")
    public AjaxResult queryByDataAndDeviceId(@RequestParam(value = "date",required = false) String date,
                                             @RequestParam(value = "deviceId") String deviceId) {
        return AjaxResult.success(this.watchThirdUaDataService.queryByDateAndDeviceId(date,deviceId));
    }

}

