# cloud-dishes **Repository Path**: suogg/cloud-dishes ## Basic Information - **Project Name**: cloud-dishes - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-24 - **Last Updated**: 2025-11-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## spring cloud 练习 有了全局异常处理(提前创建一个自定义异常),返回响应时可以通过throw 异常 代替return ResultVO.false(……) ~~~text 删除食材接口delete 1. 判断id是否存在 2. 判断食材是否存在 3. 删除食材 ~~~~ ~~~java @Override public void ingreRemoveById(Integer id) { //判断id是否存在 if (ObjectUtil.isEmpty(getById(id))) { throw new CustomException("删除食材ID不能为空"); } //判断食材是否存在 if (ObjectUtil.isEmpty(this.getById(id))) { throw new CustomException("删除食材不存在"); } this.removeById(id); } ~~~~