import request from '@/utils/request'

// 查询敏感词列表
export function listSensitiveWord(query) {
  return request({
    url: '/sensitive/word/list',
    method: 'get',
    params: query
  })
}

// 查询敏感词详细
export function getSensitiveWord(wordId) {
  return request({
    url: '/sensitive/word/' + wordId,
    method: 'get'
  })
}

// 新增敏感词
export function addSensitiveWord(data) {
  return request({
    url: '/sensitive/word',
    method: 'post',
    data: data
  })
}

// 修改敏感词
export function updateSensitiveWord(data) {
  return request({
    url: '/sensitive/word',
    method: 'put',
    data: data
  })
}

// 启用/禁用
export function changeSensitiveWordEnabled(wordId, enabled) {
  return request({
    url: '/sensitive/word/changeEnabled',
    method: 'put',
    data: { wordId, enabled }
  })
}

// 删除敏感词
export function delSensitiveWord(wordId) {
  return request({
    url: '/sensitive/word/' + wordId,
    method: 'delete'
  })
}

// 导出敏感词
export function exportSensitiveWord(query) {
  return request({
    url: '/sensitive/word/export',
    method: 'get',
    params: query
  })
}
