Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
RWDai committed May 10, 2024
1 parent de5b154 commit d7d9892
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/basic/src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl BasicQueryCondInfo {
/// 检查传入的 ``check_vars`` 是否满足 ``conds`` 中的条件
///
/// The outer level is the `OR` relationship, the inner level is the `AND` relationship
pub fn check_or_and_conds(conds: &Vec<Vec<BasicQueryCondInfo>>, check_vars: &HashMap<String, Value>) -> TardisResult<bool> {
pub fn check_or_and_conds(conds: &[Vec<BasicQueryCondInfo>], check_vars: &HashMap<String, Value>) -> TardisResult<bool> {
let is_match = conds.iter().any(|and_conds| {
and_conds.iter().all(|cond| match check_vars.get(&cond.field) {
Some(check_val) => match &cond.op {
Expand Down
10 changes: 5 additions & 5 deletions backend/basic/tests/test_rbum_rel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ async fn test_rbum_rel_with_set(context: &TardisContext) -> TardisResult<()> {

assert!(
!RbumRelServ::check_rel(
&mut RbumRelCheckReq {
&RbumRelCheckReq {
tag: "bind".to_string(),
from_rbum_kind: RbumRelFromKind::Item,
from_rbum_id: context.owner.to_string(),
Expand Down Expand Up @@ -1156,7 +1156,7 @@ async fn test_rbum_rel_use(context: &TardisContext) -> TardisResult<()> {
// Environment not match
assert!(
!RbumRelServ::check_rel(
&mut RbumRelCheckReq {
&RbumRelCheckReq {
tag: "bind".to_string(),
from_rbum_kind: RbumRelFromKind::Item,
from_rbum_id: item_reldb_inst1_id.to_string(),
Expand All @@ -1174,7 +1174,7 @@ async fn test_rbum_rel_use(context: &TardisContext) -> TardisResult<()> {
// Environment not match
assert!(
!RbumRelServ::check_rel(
&mut RbumRelCheckReq {
&RbumRelCheckReq {
tag: "bind".to_string(),
from_rbum_kind: RbumRelFromKind::Item,
from_rbum_id: item_reldb_inst1_id.to_string(),
Expand All @@ -1194,7 +1194,7 @@ async fn test_rbum_rel_use(context: &TardisContext) -> TardisResult<()> {

assert!(
RbumRelServ::check_rel(
&mut RbumRelCheckReq {
&RbumRelCheckReq {
tag: "bind".to_string(),
from_rbum_kind: RbumRelFromKind::Item,
from_rbum_id: item_reldb_inst1_id.to_string(),
Expand Down Expand Up @@ -1231,7 +1231,7 @@ async fn test_rbum_rel_use(context: &TardisContext) -> TardisResult<()> {

assert!(
!RbumRelServ::check_rel(
&mut RbumRelCheckReq {
&RbumRelCheckReq {
tag: "bind".to_string(),
from_rbum_kind: RbumRelFromKind::Item,
from_rbum_id: item_reldb_inst1_id.to_string(),
Expand Down

0 comments on commit d7d9892

Please sign in to comment.