2025-03-21 16:59:44 +08:00
|
|
|
import { http } from '@/utils/http';
|
|
|
|
import { CabinetCellDTO } from './cabinet-cell';
|
|
|
|
|
|
|
|
export interface SmartCabinetQuery extends BasePageQuery {
|
|
|
|
cabinetName?: string;
|
|
|
|
cabinetType?: number;
|
|
|
|
templateNo?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SmartCabinetDTO {
|
|
|
|
cabinetId?: number;
|
|
|
|
cabinetName: string;
|
|
|
|
cabinetType: number;
|
|
|
|
templateNo: string;
|
|
|
|
lockControlNo: number;
|
|
|
|
location: number;
|
|
|
|
operator?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AddSmartCabinetCommand {
|
|
|
|
cabinetName: string;
|
|
|
|
cabinetType: number;
|
|
|
|
templateNo: string;
|
|
|
|
lockControlNo: number;
|
|
|
|
location: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpdateSmartCabinetCommand extends AddSmartCabinetCommand {
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AllCabinetDataDTO {
|
|
|
|
smartCabinetList: SmartCabinetDTO[];
|
|
|
|
cells: CabinetCellDTO[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getSmartCabinetList = (params?: SmartCabinetQuery) => {
|
|
|
|
return http.request<ResponseData<PageDTO<SmartCabinetDTO>>>('get', '/cabinet/smartCabinet', {
|
|
|
|
params
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const addSmartCabinet = (data: AddSmartCabinetCommand) => {
|
|
|
|
return http.request<ResponseData<void>>('post', '/cabinet/smartCabinet', {
|
|
|
|
data
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const updateSmartCabinet = (id: number, data: UpdateSmartCabinetCommand) => {
|
|
|
|
return http.request<ResponseData<void>>('put', `/cabinet/smartCabinet/${id}`, {
|
|
|
|
data
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const deleteSmartCabinet = (ids: string) => {
|
|
|
|
return http.request<ResponseData<void>>('delete', `/cabinet/smartCabinet/${ids}`);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getAllCabinetsWithCells = () => {
|
|
|
|
return http.request<ResponseData<AllCabinetDataDTO>>('get', '/cabinet/smartCabinet/all');
|
|
|
|
};
|
2025-04-18 17:13:38 +08:00
|
|
|
|
|
|
|
export const allCabinets = () => {
|
|
|
|
return http.request<ResponseData<Array<SmartCabinetDTO>>>('get', '/cabinet/smartCabinet/allCabinets');
|
|
|
|
};
|