import request from '@/utils/request'
import upload from '@/utils/upload'

// 通用文件上传（RuoYi-Cloud 文件接口）
export function uploadFile(data) {
  return upload({
    url: '/file/upload',
    name: data.name || 'file',
    filePath: data.filePath
  })
}

// 查询就医记录列表
export function listDoctorRecord(query) {
  return request({
    url: '/health/doctorRecord/list',
    method: 'get',
    params: query
  })
}

// 查询就医记录详细
export function getDoctorRecord(id) {
  return request({
    url: '/health/doctorRecord/' + id,
    method: 'get'
  })
}

// 新增就医记录
export function addDoctorRecord(data) {
  return request({
    url: '/health/doctorRecord',
    method: 'post',
    data
  })
}

// 修改就医记录
export function updateDoctorRecord(data) {
  return request({
    url: '/health/doctorRecord',
    method: 'put',
    data
  })
}

// 删除就医记录
export function delDoctorRecord(id) {
  return request({
    url: '/health/doctorRecord/' + id,
    method: 'delete'
  })
}
