package storehouse import ( "fmt" "server/dao/godown" "server/model/common/request" "server/model/common/response" ) type GoodsService struct { } func (gs *GoodsService) QueryAllGoods() ([]godown.Goods, error) { return godown.QueryAllGoods() } func (gs *GoodsService) QueryGoodsList(info request.SearchGoods) (interface{}, int64, error) { limit := info.PageInfo.PageSize offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1) return godown.QueryGoodsList(limit, offset, info.CommodityId, info.WarehouseId, info.StorageAreaId, info.PlaceId) } func (gs *GoodsService) GetInventory(req request.GetInventoryRequest) response.InventoryResponse { goods, commodity, place := godown.GetInventory(req.CommodityId, req.WarehouseId, req.StorageAreaId, req.PlaceId) // 4. 返回结果 return response.InventoryResponse{ Number: goods.Number, CommodityName: commodity.Name, Location: fmt.Sprintf("仓库%d-%s-货架%s", req.WarehouseId, place.StorageArea.Name, place.Code), } }