package thyyxxk.webserver.controller.zhuyuanyiji;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.inpatient.FeeSelect;
import thyyxxk.webserver.entity.inpatient.chargeinputinquiry.AnalyzedInputItems;
import thyyxxk.webserver.entity.inpatient.chargeinputinquiry.InquiryParams;
import thyyxxk.webserver.service.zhuyuanyiji.ChargeInputInquiryService;

import java.util.List;

@RestController
@RequestMapping("/chargeInputInquiry")
public class ChargeInputInquiryController {
    private final ChargeInputInquiryService service;

    @Autowired
    public ChargeInputInquiryController(ChargeInputInquiryService service) {
        this.service = service;
    }

    @GetMapping("/selectCharges")
    public ResultVo<List<FeeSelect>> selectCharges(@RequestParam("type") Integer type,
                                                   @RequestParam("content") String content) {
        return service.selectCharges(type, content);
    }

    @PostMapping("/selectInputItems")
    public ResultVo<AnalyzedInputItems> selectInputItems(@RequestBody InquiryParams params) {
        return service.selectInputItems(params);
    }
}
