import request from "@/utils/request";


export function listManager(query) {
  return request({
    url: '/vehicleManagement/vehicle/list',
    method: 'get',
    params: query
  })
}


export function getManagerId(id) {
  return request({
    url: '/vehicleManagement/vehicle/' + id,
    method: 'get'
  })
}

export function addManager(data) {
  return request({
    url: '/vehicleManagement/vehicle/add',
    method: 'post',
    data: data
  })
}

export function updateManager(data) {
  return request({
    url: '/vehicleManagement/vehicle/edit',
    method: 'put',
    data: data
  })
}

export function testMessage() {
  return request({
    url: '/vehicleManagement/messageInfo/test',
    method: 'get'
  })
}


export function delManager(id) {
  return request({
    url: '/vehicleManagement/vehicle/' + id,
    method: 'delete'
  })
}

//----------------报---------
export function listMessage(query) {
  return request({
    url: '/vehicleManagement/messageInfo/list',
    method: 'get',
    params: query
  })
}

export function getMessage(id) {
  return request({
    url: '/vehicleManagement/messageInfo/' + id,
    method: 'get'
  })
}

export function addMessage(data) {
  return request({
    url: '/vehicleManagement/messageInfo',
    method: 'post',
    data: data
  })
}

export function updateMessageDetail(data) {
  return request({
    url: '/vehicleManagement/updateMessage',
    method: 'put',
    data: data
  })
}

export function delMessage(id) {
  return request({
    url: '/vehicleManagement/messageInfo/' + id,
    method: 'delete'
  })
}

// 查询车辆实时数据
export function getDataByRedis(carVin) {
  return request({
    url: '/vehicleManagement/redis/getDataByRedis/' + carVin,
    method: 'get'
  })
}

//提交报文
export function submit(data) {
  return request({
    url: '/vehicleManagement/vehicleMessageMiddle/submit',
    method: 'post',
    data: data
  })
}






// --------------类型-----------
// 查询车辆报文类型列表
export function listMessageType(query) {
  return request({
    url: '/vehicleManagement/messageType/list',
    method: 'get',
    params: query
  })
}

// 查询车辆报文类型详细
export function getMessageType(messageCode) {
  return request({
    url: '/vehicleManagement/messageType/' + messageCode,
    method: 'get'
  })
}

// 新增车辆报文类型
export function addMessageType(data) {
  return request({
    url: '/vehicleManagement/messageType',
    method: 'post',
    data: data
  })
}

// 修改车辆报文类型
export function updateMessageType(data) {
  return request({
    url: '/vehicleManagement/messageType',
    method: 'put',
    data: data
  })
}

// 删除车辆报文类型
export function delMessageType(id) {
  return request({
    url: '/vehicleManagement/messageType/' + id,
    method: 'delete'
  })
}


