fix: 联合调试问题修复 — 预约错误提示 + request 错误提取 + copilot 解包

- ISSUE-APPOINTMENT-001: 后端 DoctorNotFound 改为 Validation 错误(400)
  + 改善错误消息"所选医生暂无医护档案,请联系管理员"
  + 小程序预约创建 catch 传递实际错误消息(不再硬编码"预约失败")
  + 小程序 request.ts 提取后端 message 字段作为用户提示
- copilot API: listInsights/listRules/getPatientRisk 补齐 data.data 解包
- 移除 error.rs 重复的 AppointmentNotFound 分支
This commit is contained in:
iven
2026-05-15 15:25:26 +08:00
parent 057d9b5896
commit 4ca9027cd6
4 changed files with 21 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ pub enum HealthError {
#[error("患者不存在")]
PatientNotFound,
#[error("医护档案不存在")]
#[error("所选医生暂无医护档案,请联系管理员")]
DoctorNotFound,
#[error("预约不存在")]
@@ -124,9 +124,10 @@ impl From<HealthError> for AppError {
fn from(err: HealthError) -> Self {
match err {
HealthError::Validation(s) => AppError::Validation(s),
HealthError::PatientNotFound
| HealthError::DoctorNotFound
| HealthError::AppointmentNotFound
HealthError::PatientNotFound | HealthError::DoctorNotFound => {
AppError::Validation(err.to_string())
}
HealthError::AppointmentNotFound
| HealthError::ScheduleNotFound
| HealthError::VitalSignsNotFound
| HealthError::LabReportNotFound