import request from '@/config/axios'
|
|
export interface ModBusDeviceVO {
|
id: string
|
name: string
|
address: string
|
port: number
|
connectInactivityTimeout: number
|
reconnectInterval: number
|
attemptsBeforeTimeout: number
|
waitToRetryMilliseconds: number
|
readTimeout: number
|
writeTimeout: number
|
useOptimizedBlockRead: boolean
|
projectReference: string
|
}
|
|
export interface ModBusDevicePageReqVO extends PageParam {
|
name?: string
|
address?: string
|
}
|
|
// 查询ModBusDevice列表
|
export const getModBusDevicePage = (params: ModBusDevicePageReqVO) => {
|
return request.get({ url: '/data/channel/modbus/device/page', params })
|
}
|
|
// 查询ModBusDevice详情
|
export const getModBusDevice = (id: number) => {
|
return request.get({ url: `/data/channel/modbus/device/info/${id}`})
|
}
|
|
// 新增ModBusDevice
|
export const createModBusDevice = (data: ModBusDeviceVO) => {
|
return request.post({ url: '/data/channel/modbus/device/create', data })
|
}
|
|
// 修改ModBusDevice
|
export const updateModBusDevice = (data: ModBusDeviceVO) => {
|
return request.put({ url: '/data/channel/modbus/device/update', data })
|
}
|
|
// 删除ModBusDevice
|
export const deleteModBusDevice = (id: number) => {
|
return request.delete({ url: '/data/channel/modbus/device/delete?id=' + id })
|
}
|