import request from '@/utils/request'

// 查询失物寻物列表
export function listLostfound(query) {
  return request({
    url: `/biz/lost-found${query.type ? '/'+query.type : ''}/list`,
    method: 'get',
    params: query
  })
}

// 查询失物寻物详细
export function getLostfound(query) {
  return request({
    url: `/biz/lost-found${query.type ? '/'+query.type : ''}/` + query.id,
    method: 'get'
  })
}

// 新增失物寻物
export function addLostfound(data) {
  return request({
    url: `/biz/lost-found${data.type ? '/'+data.type : ''}/info`,
    method: 'post',
    data: data
  })
}

// 修改失物寻物
export function updateLostfound(data) {
  return request({
    url: `/biz/lost-found${data.type ? '/'+data.type : ''}/info/${data.id}`,
    method: 'put',
    data: data
  })
}

// 删除失物寻物
export function delLostfound(data) {
  return request({
    url: `/biz/lost-found${data.type ? '/'+data.type : ''}/` + data.id,
    method: 'delete'
  })
}

// 审核
export function verifyLostfound(data) {
  console.log(data, 'data');
  return request({
    url: `/biz/lost-found${data.type ? '/'+data.type : ''}/status/${data.id}`,
    method: 'put',
    data: data
  })
}