package thyyxxk.webserver.controller.inpatient.nursemodule;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.inpatient.nursemodule.request.UpdatePrintStatus;
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBed;
import thyyxxk.webserver.entity.inpatient.nursemodule.request.QueryInfusionCard;
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientInfusionInfo;
import thyyxxk.webserver.service.inpatient.nursemodule.PrintInfusionCardService;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;

@RestController
@RequestMapping("/printInfusionCard")
public class PrintInfusionCardController {
    private final PrintInfusionCardService service;

    @Autowired
    public PrintInfusionCardController(PrintInfusionCardService service) {
        this.service = service;
    }

    @GetMapping("/getPatientBeds")
    public ResultVo<List<PatientBed>> getPatientBeds(@RequestParam("wardCode") String wardCode) {
        return service.getPatientBeds(wardCode);
    }

    @PostMapping("/queryInfusionCardOrBottleCard")
    public ResultVo<List<PatientInfusionInfo>> queryInfusionCardOrBottleCard(@RequestBody QueryInfusionCard params) {
        return service.queryInfusionCardOrBottleCard(params);
    }

    @PostMapping("/updatePrintStatus")
    public ResultVo<String> updatePrintStatus(@RequestBody UpdatePrintStatus request) {
        return ResultVoUtil.success(service.updatePrintStatus(request));
    }
}