|
|
|
@ -0,0 +1,38 @@
|
|
|
|
|
package com.example.api.service;
|
|
|
|
|
|
|
|
|
|
import com.example.api.model.entity.Inventory; // 导入Inventory实体类,代表库存信息
|
|
|
|
|
import java.util.List; // 导入List类,用于处理列表数据
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 库存服务接口,定义库存相关的业务操作。
|
|
|
|
|
*/
|
|
|
|
|
public interface InventoryService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存库存信息。
|
|
|
|
|
* @param inventory 库存实体对象,包含库存的各个属性
|
|
|
|
|
* @return 保存后的库存实体对象,包含由数据库生成的ID等信息
|
|
|
|
|
*/
|
|
|
|
|
Inventory save(Inventory inventory);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询所有库存信息。
|
|
|
|
|
* @return 库存实体对象列表,包含所有库存的详细信息
|
|
|
|
|
*/
|
|
|
|
|
List<Inventory> findAll();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据商品ID查询库存信息。
|
|
|
|
|
* @param cid 商品ID
|
|
|
|
|
* @return 与指定商品ID相关的库存实体对象列表
|
|
|
|
|
*/
|
|
|
|
|
List<Inventory> findByCommodityId(String cid);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据仓库ID查询库存信息。
|
|
|
|
|
* @param wid 仓库ID
|
|
|
|
|
* @return 与指定仓库ID相关的库存实体对象列表
|
|
|
|
|
*/
|
|
|
|
|
List<Inventory> findByWarehouseId(String wid);
|
|
|
|
|
|
|
|
|
|
}
|