package com.fs.watch.controller;

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

import javax.annotation.Resource;

/**
 * 三方血酮(WatchThirdBkData)表控制层
 *
 * @author makejava
 * @since 2024-08-20 09:26:33
 */
@RestController
@RequestMapping("/watch/third/bk")
public class WatchThirdBkDataController {
    /**
     * 服务对象
     */
    @Resource
    private WatchThirdBkDataService watchThirdBkDataService;


    @PostMapping("/insert")
    public AjaxResult insertThirdBkData(@RequestBody WatchThirdBkData data){
        return AjaxResult.success(watchThirdBkDataService.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.watchThirdBkDataService.queryByDateAndDeviceId(date,deviceId));
    }


}

