package thyyxxk.webserver.service.zhuyuanyisheng;

import org.springframework.stereotype.Service;
import thyyxxk.webserver.config.exception.ExceptionEnum;
import thyyxxk.webserver.dao.his.zhuyuanyisheng.PatientFamilyDao;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.zhuyuanyisheng.PatientFamily;
import thyyxxk.webserver.utils.ResultVoUtil;

@Service
public class PatientFamilyServer {
    private final PatientFamilyDao dao;

    public PatientFamilyServer(PatientFamilyDao dao) {
        this.dao = dao;
    }

    public ResultVo<Integer> insert(PatientFamily pf) {
        dao.insert(pf);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
    }

    public ResultVo<Integer> update(PatientFamily pf) {
        dao.updateById(pf);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
    }

    public ResultVo<Integer> delete(String id) {
        dao.deleteById(id);
        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
    }


}
