package com.ruoyi.web.work.api;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.web.work.api.config.BaseController;
import com.ruoyi.web.work.api.util.AppUtil;
import com.ruoyi.web.work.domain.dto.Pv1MedicalRecord;
import com.ruoyi.web.work.service.IPv1Service;
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;


@Api(tags = "小程序住院信息管理")
@RestController
@RequestMapping("/app/pv1")
public class Api_Pv1Controller extends BaseController {

    @Autowired
    private IPv1Service ipv1Service;

    @ApiOperation(value = "根据时间获取用户就医记录")
    @GetMapping("/record")
    public TableDataInfo getMedicalRecord(@RequestParam("beginTime") String beginTime,
                                          @RequestParam("endTime") String endTime,
                                          @RequestParam("patientId") Long patientId){
        startPage();
        List<Pv1MedicalRecord> pv1List=ipv1Service.getMedicalRecord(beginTime,endTime,patientId);
        return getDataTable(pv1List);
    }


}
