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; mqttServerId?: number; shopId?: number; templateNo: string; lockControlNo: number; location: number; operator?: string; } export interface AddSmartCabinetCommand { cabinetName: string; cabinetType: number; mqttServerId?: number; shopId?: number; templateNo: string; lockControlNo: number; location: number; } export interface UpdateSmartCabinetCommand { cabinetId: number; cabinetName?: string; cabinetType?: number; mqttServerId?: number; shopId?: number; templateNo?: string; lockControlNo?: number; location?: number; } export interface AllCabinetDataDTO { smartCabinetList: SmartCabinetDTO[]; cells: CabinetCellDTO[]; } export const getSmartCabinetList = (params?: SmartCabinetQuery) => { return http.request>>('get', '/cabinet/smartCabinet', { params }); }; export const addSmartCabinet = (data: AddSmartCabinetCommand) => { return http.request>('post', '/cabinet/smartCabinet', { data }); }; export const updateSmartCabinet = (id: number, data: UpdateSmartCabinetCommand) => { return http.request>('put', `/cabinet/smartCabinet/${id}`, { data }); }; export const deleteSmartCabinet = (ids: string) => { return http.request>('delete', `/cabinet/smartCabinet/${ids}`); }; export const getAllCabinetsWithCells = () => { return http.request>('get', '/cabinet/smartCabinet/all'); }; export const allCabinets = () => { return http.request>>('get', '/cabinet/smartCabinet/allCabinets'); };