diff --git a/src/api/iot/device/group/index.ts b/src/api/iot/device/group/index.ts new file mode 100644 index 0000000..96c26f0 --- /dev/null +++ b/src/api/iot/device/group/index.ts @@ -0,0 +1,32 @@ +import request from '@/config/axios' + +export interface DeviceGroupVO { + id?: number + name: string + status: number + description?: string + deviceCount?: number + createTime?: Date +} + +export const DeviceGroupApi = { + getDeviceGroupPage: async (params: any) => { + return await request.get({ url: '/iot/device-group/page', params }) + }, + + getDeviceGroup: async (id: number) => { + return await request.get({ url: '/iot/device-group/get?id=' + id }) + }, + + createDeviceGroup: async (data: DeviceGroupVO) => { + return await request.post({ url: '/iot/device-group/create', data }) + }, + + updateDeviceGroup: async (data: DeviceGroupVO) => { + return await request.put({ url: '/iot/device-group/update', data }) + }, + + deleteDeviceGroup: async (id: number) => { + return await request.delete({ url: '/iot/device-group/delete?id=' + id }) + } +}