package nju.seec.helper.dao; import nju.seec.helper.entity.Reply; import nju.seec.helper.util.exception.HelperException; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * @author cst */ @Repository public interface ReplyDAO extends JpaRepository { /** * 封装findById * * @param id * @return */ default Reply findReplyById(Integer id) { return this.findById(id) .orElseThrow(() -> HelperException.of(HelperException.ExceptionType.NOT_FOUND, "找不到回复")); } }