package digital.laboratory.platform.inspetion.api.feign;

import cn.hutool.json.JSONObject;
import digital.laboratory.platform.inspetion.api.entity.IdentificationBookDTO;
import digital.laboratory.platform.inspetion.api.feign.factory.RemoteTestToIdentifyServiceFallbackFactory;
import digital.laboratory.platform.common.core.constant.SecurityConstants;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.inspetion.api.vo.TestRecordVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author xy
 * @version 1.0
 * @title 检验系统对文书系统提供的接口
 * @description
 * @create 2024/2/26 15:01
 */
@FeignClient(contextId = "remoteTestToIdentifyService", value ="dlp-drugtesting-biz",
        fallbackFactory = RemoteTestToIdentifyServiceFallbackFactory.class)
public interface RemoteTestToIdentifyService {
    /**
     * 提供读取实验数据的接口
     * @param businessId
     * @return
     */
    @GetMapping(value="/identifyBookData/getIdentifyBookDataByBusinessId", headers = SecurityConstants.HEADER_FROM_IN)
    R<IdentificationBookDTO> getIdentifyBookDataByBusinessId(@RequestParam("businessId") String businessId);

    @PostMapping(value="/identifyBookData/getTestFinishBusinessData", headers = SecurityConstants.HEADER_FROM_IN)
    R getTestFinishBusinessData(@RequestBody List<String> synedIdList);

    /**
     * 根据业务id获取实验信息
     * @param businessIds 业务id列表
     * @return
     */
    @PostMapping(value = "/testRecord/queryTestRecordInfoByBusinessId", headers = SecurityConstants.HEADER_FROM_IN)
    R<Map<String, TestRecordVo>> queryTestRecordInfoByBusinessId(@RequestBody List<String> businessIds);

    /**
     * 获取推送检验记录的数据
     * @param entrustId 委托id
     * @return
     */
    @PostMapping(value = "/pushDataToLabsCare/inspectRecord", headers = SecurityConstants.HEADER_FROM_IN)
    R<JSONObject> inspectRecord(@RequestParam("entrustId") String entrustId);

}
