Enrich external API failure audit metadata

This commit is contained in:
kdletters
2026-05-28 15:42:46 +08:00
parent 2cd2b9704b
commit f1fb92aa29
40 changed files with 315 additions and 152 deletions

View File

@@ -325,11 +325,15 @@ fn validate_admin_work_visibility(
) -> Result<(String, String, bool), AppError> {
let source_type = payload.source_type.trim().to_string();
if source_type.is_empty() {
return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("sourceType 不能为空"));
return Err(
AppError::from_status(StatusCode::BAD_REQUEST).with_message("sourceType 不能为空")
);
}
let profile_id = payload.profile_id.trim().to_string();
if profile_id.is_empty() {
return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("profileId 不能为空"));
return Err(
AppError::from_status(StatusCode::BAD_REQUEST).with_message("profileId 不能为空")
);
}
Ok((source_type, profile_id, payload.visible))
}