20260718 格式化查询服务代码

This commit is contained in:
yuyr 2026-07-18 10:40:51 +08:00
parent a5902c0a5e
commit c48dc04909
2 changed files with 9 additions and 4 deletions

View File

@ -2104,8 +2104,14 @@ fn object_filter_from_query(query: &BTreeMap<String, String>) -> Result<ObjectFi
filter.object_type = Some(normalized.to_string()); filter.object_type = Some(normalized.to_string());
} }
if let Some(value) = query.get("result") { if let Some(value) = query.get("result") {
if !matches!(value.to_ascii_lowercase().as_str(), "ok" | "error" | "skipped") { if !matches!(
return Err(ApiError::new(400, format!("invalid result filter: {value}"))); value.to_ascii_lowercase().as_str(),
"ok" | "error" | "skipped"
) {
return Err(ApiError::new(
400,
format!("invalid result filter: {value}"),
));
} }
filter.result = Some(value.clone()); filter.result = Some(value.clone());
} }

View File

@ -772,8 +772,7 @@ fn process_raw_publication_point(
let after_cursor = pp_index > state.start_pp_index let after_cursor = pp_index > state.start_pp_index
|| (pp_index == state.start_pp_index || (pp_index == state.start_pp_index
&& object_index >= state.start_object_index); && object_index >= state.start_object_index);
if after_cursor && state.data.len() < state.limit && state.filter.matches(&record) if after_cursor && state.data.len() < state.limit && state.filter.matches(&record) {
{
state.data.push(record); state.data.push(record);
if state.data.len() == state.limit { if state.data.len() == state.limit {
state.next_cursor = Some(object_cursor(pp_index, object_index + 1)); state.next_cursor = Some(object_cursor(pp_index, object_index + 1));