微服务实现:餐厅服务及相关服务的构建与部署
1. 服务类设计
1.1 餐厅服务接口
餐厅服务接口 RestaurantService 定义了餐厅资源的 CRUD 操作和一些搜索操作,代码如下:
public interface RestaurantService {
public void add(Restaurant restaurant) throws Exception;
public void update(Restaurant restaurant) throws Exception;
public void delete(String id) throws Exception;
public Entity findById(String restaurantId) throws Exception;
public Collection<Restaurant> findByName(String name) throws Exception;
public Collection<Restaurant> findByCriteria(Map<String, ArrayList<String>> name) throws Exception;
}
1.2 餐厅服务实现类
RestaurantServiceImpl 实现了 RestaurantService 接口,并继承
超级会员免费看
订阅专栏 解锁全文
888

被折叠的 条评论
为什么被折叠?



