package com.fs.his.controller;


import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.enums.BusinessType;
import com.fs.his.param.FsInquiryPatientParam;
import com.fs.his.service.IFsInquiryPatientInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 问诊患者信息(FsInquiryPatientInfo)
 */
@RestController
@RequestMapping("/his/inquiryPatientInfo")
public class FsInquiryPatientInfoController extends BaseController {


    @Autowired
    private IFsInquiryPatientInfoService patientInfoService;




    /**
     * 新增患者问诊信息
     */
    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:add')")
    @Log(title = "患者问诊信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody FsInquiryPatientParam param){
        return toAjax(patientInfoService.insertFsInquiryPatientInfo(param));
    }

    /**
     * 修改患者问诊信息
     */
    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:edit')")
    @Log(title = "患者问诊信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody FsInquiryPatientParam param){
        return toAjax(patientInfoService.updateFsInquiryPatientInfo(param));
    }

    @GetMapping("/detail/{inquiryOrderId}")
    public AjaxResult get(@PathVariable("inquiryOrderId") Long inquiryOrderId){
        return AjaxResult.success(patientInfoService.selectFsInquiryPatientInfo(inquiryOrderId));
    }
}
