package com.hxhq.controller;

import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.dto.InstrumentPushDTO;
import com.hxhq.service.InstrumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 仪器
 * 
 * @author hxhq
 */
@RestController
@RequestMapping("/instrument")
public class InstrumentController extends BaseController
{
    @Autowired
    private InstrumentService instrumentService;

    /**
     *
     * 仪器数据推送至中间库
     * @param dto
     * @create 2026/1/29
     **/
    @PostMapping("/dataPush")
    public AjaxResult dataPush(InstrumentPushDTO dto) {
        instrumentService.dataPush(dto);
      return  AjaxResult.success("推送数据成功");
    }
    /**
     *
     * 仪器数据同步
     * @create 2026/1/29
     **/
    @GetMapping("/dataSync")
    public AjaxResult dataSync() {
        instrumentService.dataSync();
        return  AjaxResult.success("同步成功");
    }
}
