|
@@ -239,9 +239,13 @@ public class HealthReportController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String reportType = (String) params.get("reportType");
|
|
String reportType = (String) params.get("reportType");
|
|
|
- if (reportType == null) {
|
|
|
|
|
|
|
+ if (reportType == null || reportType.trim().isEmpty()) {
|
|
|
return Result.error("reportType不能为空: physical_exam / gut_flora");
|
|
return Result.error("reportType不能为空: physical_exam / gut_flora");
|
|
|
}
|
|
}
|
|
|
|
|
+ // 契约 §4.59.2:reportType 仅允许 physical_exam / gut_flora,其余取值(空串/非法值)一律拒绝
|
|
|
|
|
+ if (!"physical_exam".equals(reportType) && !"gut_flora".equals(reportType)) {
|
|
|
|
|
+ return Result.error("不支持的reportType: physical_exam / gut_flora");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 构建报告主体
|
|
// 构建报告主体
|
|
|
HealthReport report = new HealthReport();
|
|
HealthReport report = new HealthReport();
|