
import request from '@/utils/request'

// 新增
export function voteAdd(data) {
  return request({
    url: `/vote/activity`,
    method: 'post',
    data
  })
}

// 删除
export function voteDel(data) {
  return request({
      url: `/vote/activity`,
      method: 'delete',
      data: data
  })
}

// 修改
export function voteUpdate(data) {
  return request({
    url: `/vote/activity/${data.activityId}`,
    method: 'put',
    data: data
  })
}

// 查询List
export function voteQuery(query) {
  return request({
    url: `/vote/activity/list`,
    method: 'get',
    params: query
  })
}

// 查询详情
export function voteFetch(id) {
  return request({
    url: `/vote/activity/${id}`,
    method: 'get'
  })
}

// 审核列表
export function enlistsList(query) {
  return request({
    url: `/vote/enlists/list`,
    method: 'get',
    params: query
  })
}

// 审核详情
export function enlistsInfo(enlistId) {
  return request({
    url: `/vote/enlists/${enlistId}`,
    method: 'get'
  })
}

// 审核
export function enlistsReview(data) {
  return request({
    url: `/vote/enlists/review/${data.enlistsId}`,
    method: 'post',
    data
  })
}

// 统计
export function rankings(query) {
  return request({
    url: `/vote/enlists/rankings/${query.activityId}`,
    method: 'get',
    params: query
  })
}

// 增加报名
export function enlistsAdd(data) {
  return request({
    url: `/vote/enlists`,
    method: 'post',
    data
  })
}

// 修改报名
export function enlistsUpdata(data) {
  return request({
    url: `/vote/enlists/${data.enlistsId}`,
    method: 'put',
    data
  })
}
