package com.aegis.emergency.plan.service.impl;

import com.aegis.emergency.plan.domain.PlanApproval;
import com.aegis.emergency.plan.mapper.PlanApprovalMapper;
import com.aegis.emergency.plan.service.IPlanApprovalService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * 预案审批 Service 实现
 */
@Service
public class PlanApprovalServiceImpl extends ServiceImpl<PlanApprovalMapper, PlanApproval> implements IPlanApprovalService {

    @Override
    public PlanApproval recordApproval(PlanApproval approval) {
        Objects.requireNonNull(approval, "approval must not be null");
        Objects.requireNonNull(approval.getPlanId(), "planId must not be null");
        this.save(approval);
        return approval;
    }
}