import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/topic/list',
    method: 'get',
    params: query
  })
}


export function OffLineOrOnLine(data) {
  return request({
    url: '/api/topic/update_or_create',
    method: 'post',
    data
  })
}

export function createRemark(data) {
  return request({
    url: '/api/topic/reply/create',
    method: 'post',
    data
  })
}

export function fetchTopic(id) {
  return request({
    url: '/api/topic/detail',
    method: 'get',
    params: { id }
  })
}

export function createTopic(data) {
  return request({
    url: '/api/topic/create',
    method: 'post',
    data
  })
}

export function fetchReply(query) {
  return request({
    url: '/api/topic/reply/list',
    method: 'get',
    params: query
  })
}

export function DelReply(data) {
  return request({
    url: '/api/topic/reply/batch_delete',
    method: 'post',
    data
  })
}

export function ModifyReply(data) {
  return request({
    url: '/api/topic/reply/create',
    method: 'post',
    data
  })
}
