import request from '@/config/axios'

// netty客户端连接 VO
export interface TcpClientLogVO {
  id: number // id
  name: string // 连接名称
  port: number // 端口
  ip: string // ip
  tcpType: string // 处理器类型
  info: string // 信息
  type: number // 类型，接收或发送
}

// netty客户端连接 API
export const TcpClientLogApi = {
  // 查询netty客户端连接分页
  getTcpClientLogPage: async (params: any) => {
    return await request.get({ url: `/logistics/tcp-client-log/page`, params })
  },

  // 查询netty客户端连接详情
  getTcpClientLog: async (id: number) => {
    return await request.get({ url: `/logistics/tcp-client-log/get?id=` + id })
  },

  // 新增netty客户端连接
  createTcpClientLog: async (data: TcpClientLogVO) => {
    return await request.post({ url: `/logistics/tcp-client-log/create`, data })
  },

  // 修改netty客户端连接
  updateTcpClientLog: async (data: TcpClientLogVO) => {
    return await request.put({ url: `/logistics/tcp-client-log/update`, data })
  },

  // 删除netty客户端连接
  deleteTcpClientLog: async (id: number) => {
    return await request.delete({ url: `/logistics/tcp-client-log/delete?id=` + id })
  },

  // 导出netty客户端连接 Excel
  exportTcpClientLog: async (params) => {
    return await request.download({ url: `/logistics/tcp-client-log/export-excel`, params })
  },
}
