import {request} from '@/utils/request.js'

/**
 * 问题反馈列表
 * @param data
 * @returns
 */
export function getSnapshotByList(data) {
  return request({
    url: '/snapshot',
    method: 'GET',
    params: data
  })
}

/**
 * 问题反馈列表
 * @param data
 * @returns
 */
export function getSnapshotByPage(data) {
  return request({
    url: '/snapshot/page',
    method: 'GET',
    data
  })
}

/**
 * 获取问题反馈详情
 * @param snapshotId
 * @returns
 */
export function getSnapshotById(snapshotId) {
  return request({
    url: `/snapshot/${snapshotId}`,
    method: 'GET'
  })
}
/**
 * 添加问题反馈
 * @param data
 * @returns
 */
export function createSnapshot(data) {
  return request({
    url: `/snapshot/add`,
    method: 'POST',
    data
  })
}
/**
 * 完成处理
 * @param snapshotId
 * @param data
 * @returns
 */
export function completeSnapshot(snapshotId, data) {
  return request({
    url: "/snapshot/complete",
    method: 'POST',
    data
  })
}

/**
 * 转交他人
 * @param snapshotId
 * @param data
 * @returns
 */
export function transferSnapshot(snapshotId, data) {
  return request({
    url: `/snapshot/transfer/${snapshotId}`,
    method: 'POST',
    data
  })
}

/**
 * 撤消
 * @param snapshotId
 * @returns
 */
export function cancelSnapshot(snapshotId) {
  return request({
    url: `/snapshot/cancel/${snapshotId}`,
    method: 'GET'
  })
}

/**
 * 基于ID删除
 * @param snapshotId
 * @returns
 */
export function deleteSnapshotById(snapshotId) {
  return request({
    url: `/snapshot/${snapshotId}`,
    method: 'DELETE'
  })
}

/**
 * 查询统计结果
 */
export function getSnapshotCounter() {
  return request({
    url: '/snapshot/statis/counterByStatus',
    method: 'GET'
  })
}

