diff --git a/src/common/apis/cabinet/index.ts b/src/common/apis/cabinet/index.ts index 665ead2..a12a059 100644 --- a/src/common/apis/cabinet/index.ts +++ b/src/common/apis/cabinet/index.ts @@ -1,5 +1,5 @@ import { request } from '@/http/axios' -import type { CabinetDetailResponse } from './type' +import type { CabinetDetailResponse, RentingCabinetDetailDTO } from './type' import { OpenCabinetApiData } from '../shop/type' /** 获取智能柜详情接口 */ @@ -13,6 +13,17 @@ export function getCabinetDetailApi(shopId: number) { }) } +/** 获取租用中的智能柜详情接口 */ +export function getRentingCabinetDetailApi(shopId: number) { + return request>({ + url: 'cabinet/detail/renting', + method: 'get', + params: { + shopId + } + }) +} + export function openCabinet(cabinetId: number, pinNo: number, data: OpenCabinetApiData) { return request>({ url: `cabinet/openCabinet/${cabinetId}/${pinNo}`, diff --git a/src/common/apis/cabinet/type.ts b/src/common/apis/cabinet/type.ts index d409040..4c57c07 100644 --- a/src/common/apis/cabinet/type.ts +++ b/src/common/apis/cabinet/type.ts @@ -5,6 +5,46 @@ export interface CabinetDetailDTO { cells: CellInfoDTO[] } +/** 租用中的智能柜详情DTO */ +export interface RentingCabinetDetailDTO { + /** 柜机ID */ + cabinetId: number + /** 柜机名称 */ + cabinetName: string + /** 锁控编号 */ + lockControlNo: number + /** 柜格列表 */ + cells: CabinetCellEntity[] +} + +/** 智能柜格口实体类 */ +export interface CabinetCellEntity { + /** 格口唯一ID */ + cellId: number + /** 关联柜机ID */ + cabinetId: number + /** 主板ID */ + mainboardId?: number + /** 格口号 */ + cellNo: number + /** 针脚序号 */ + pinNo: number + /** 库存数量 */ + stock: number + /** 格口价格 */ + cellPrice?: number + /** 是否已租用:0-未租用,1-已租用 */ + isRented: number + /** 格口类型(1小格 2中格 3大格 4超大格) */ + cellType: number + /** 使用状态:1空闲 2已占用 */ + usageStatus: number + /** 可用状态:1正常 2故障 */ + availableStatus: number + /** 商品ID */ + goodsId?: number +} + export interface CellInfoDTO { cellId: number cellNo: number