20260718 格式化查询服务代码
This commit is contained in:
parent
a5902c0a5e
commit
c48dc04909
@ -2104,8 +2104,14 @@ fn object_filter_from_query(query: &BTreeMap<String, String>) -> Result<ObjectFi
|
||||
filter.object_type = Some(normalized.to_string());
|
||||
}
|
||||
if let Some(value) = query.get("result") {
|
||||
if !matches!(value.to_ascii_lowercase().as_str(), "ok" | "error" | "skipped") {
|
||||
return Err(ApiError::new(400, format!("invalid result filter: {value}")));
|
||||
if !matches!(
|
||||
value.to_ascii_lowercase().as_str(),
|
||||
"ok" | "error" | "skipped"
|
||||
) {
|
||||
return Err(ApiError::new(
|
||||
400,
|
||||
format!("invalid result filter: {value}"),
|
||||
));
|
||||
}
|
||||
filter.result = Some(value.clone());
|
||||
}
|
||||
|
||||
@ -772,8 +772,7 @@ fn process_raw_publication_point(
|
||||
let after_cursor = pp_index > state.start_pp_index
|
||||
|| (pp_index == state.start_pp_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);
|
||||
if state.data.len() == state.limit {
|
||||
state.next_cursor = Some(object_cursor(pp_index, object_index + 1));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user