package digital.laboratory.platform.inspection.controller;

import cn.hutool.json.JSONObject;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.inspection.service.PushDataToLabsCareService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ChenJiangBao
 * @version 1.0
 * @description: 推送数据到LabsCare平台接口管理
 * @date 2025/4/3 10:48
 */
//@RestController
@RequestMapping("/pushDataToLabsCare")
@Api(tags = "19-推送数据到LabsCare平台接口管理", description = "推送数据到LabsCare平台接口管理")
public class PushDataToLabsCareController {



    @Resource
    private PushDataToLabsCareService pushDataToLabsCareService;

    @ApiOperation("获取推送检验记录的数据")
    @PostMapping("/inspectRecord")
    public R<JSONObject> inspectRecord(@RequestParam("entrustId") String entrustId) {

        try {
            return R.ok(pushDataToLabsCareService.fetchInspectRecordData(entrustId));
        } catch (Exception e) {
            return R.failed(e.getMessage());
        }
    }

}
