package com.ruoyi.web.work.api;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.work.domain.Request;
import com.ruoyi.web.work.domain.dto.ObrRequestDto;
import com.ruoyi.web.work.service.IRequestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 检测报告列表
 */
@RestController
@RequestMapping("/app/obrRequest")
@Api(tags = "小程序检测报告列表")
public class Api_ObrRequestController {

    @Autowired
    private IRequestService obrRequestService;


    /**
     * 根据患者id查询患者报告
     * @param patId
     * @return
     */
    @ApiOperation(value = "检测报告列表")
    @GetMapping("/{patId}")
    public AjaxResult getObrRequestByCardId(@PathVariable String patId,@RequestParam(value = "startTime",required = false) String startTime,
                                            @RequestParam(value = "endTime",required = false) String endTime){
        List<ObrRequestDto> obrRequestList = obrRequestService.getRequestByPatId(patId,startTime,endTime);
        return AjaxResult.success(obrRequestList);
    }
}
