feat(智能柜): 添加获取租用中智能柜详情接口及相关类型定义

新增获取租用中智能柜详情的API接口函数getRentingCabinetDetailApi
添加RentingCabinetDetailDTO和CabinetCellEntity类型定义
This commit is contained in:
dzq 2025-06-26 11:39:53 +08:00
parent 6e49347de2
commit b9e0077b4d
2 changed files with 52 additions and 1 deletions

View File

@ -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<ApiResponseData<RentingCabinetDetailDTO[]>>({
url: 'cabinet/detail/renting',
method: 'get',
params: {
shopId
}
})
}
export function openCabinet(cabinetId: number, pinNo: number, data: OpenCabinetApiData) {
return request<ApiResponseData<void>>({
url: `cabinet/openCabinet/${cabinetId}/${pinNo}`,

View File

@ -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