import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/sing_active/activehelprecord/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/sing_active/activehelprecord/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/sing_active/activehelprecord/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/sing_active/activehelprecord/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/sing_active/activehelprecord/submit',
    method: 'post',
    data: row
  })
}


export const getVote = (productId) => {
  return request({
    url: '/api/sing_active/activehelprecord/vote',
    method: 'get',
    params: {
      productId
    }
  })
}

export const setStatusHide = (recordIds) => {
  return request({
    url: '/api/sing_active/activehelprecord/recordHide',
    method: 'post',
    params: {
      recordIds
    }
  })
}

export const setStatusShow = (recordIds) => {
  return request({
    url: '/api/sing_active/activehelprecord/recordShow',
    method: 'post',
    params: {
      recordIds
    }
  })
}

export const setStatusHideByIp = (ips) => {
  return request({
    url: '/api/sing_active/activehelprecord/recordHideByIp',
    method: 'post',
    params: {
      ips
    }
  })
}

export const setStatusShowByIp = (ips) => {
  return request({
    url: '/api/sing_active/activehelprecord/recordShowByIp',
    method: 'post',
    params: {
      ips
    }
  })
}

export const recordExport = (activeHelpRecordVO) => {
  return request({
    url: '/api/sing_active/activehelprecord/recordExport',
    method: 'get',
    params: {
      ...activeHelpRecordVO
    }
  })
}
