import request from '@/utils/request'

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

export function lastRefresh() {
  return request({
    url: '/sensitive/word/lastRefresh',
    method: 'get',
  })
}

export function updateSensitiveConfig(data) {
  return request({
    url: '/sensitive/word/updateSensitiveConfig',
    method: 'post',
    data: data
  })
}

export function getSensitiveConfig() {
  return request({
    url: '/sensitive/word/getSensitiveConfig',
    method: 'get',
  })
}

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

export function refreshWord() {
  return request({
    url: '/sensitive/word/refresh',
    method: 'get'
  })
}

export function testWord(data) {
  return request({
    url: '/sensitive/word/test',
    method: 'post',
    data: data
  })
}

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

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

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