import request from '@/utils/request'

/** 我的预约列表 */
export function listMyAppointments(params) {
  return request({
    url: '/app/myAppointment/list',
    method: 'GET',
    params
  })
}

/** 取消预约 */
export function cancelMyAppointment(id) {
  return request({
    url: `/app/myAppointment/cancel/${id}`,
    method: 'POST',
    header: { repeatSubmit: false }
  })
}

/** 查看预约评价（专家、已完成） */
export function getMyAppointmentReview(id) {
  return request({
    url: `/app/myAppointment/${id}/review`,
    method: 'GET'
  })
}

/** 提交预约评价 */
export function submitMyAppointmentReview(id, data) {
  return request({
    url: `/app/myAppointment/${id}/review`,
    method: 'POST',
    header: { repeatSubmit: false },
    data
  })
}
