Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ideal-world/bios
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Dec 7, 2023
2 parents b24fc0c + 6b3ff9f commit 5c2348f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
3 changes: 1 addition & 2 deletions support/iam/src/basic/dto/iam_res_dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ pub struct MenuItem {
pub kind: String,
}


#[derive(poem_openapi::Object, Serialize, Deserialize, Debug)]
pub struct IamResAppReq {
pub app_ids: Vec<String>,
pub res_codes: Vec<String>,
}
}
44 changes: 28 additions & 16 deletions support/reach/src/serv/message_send.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::{HashMap, HashSet};
use std::collections::HashMap;

use bios_basic::rbum::{dto::rbum_item_dto::RbumItemAddReq, serv::rbum_crud_serv::RbumCrudOperation};
use tardis::{
Expand Down Expand Up @@ -64,26 +64,38 @@ pub async fn message_send(send_req: ReachMsgSendReq, funs: &TardisFunsInst, ctx:
return Ok(());
}

let (other_receive_collect, other_group_code) = receive_group_code.into_iter().fold(
(HashMap::new(), HashSet::new()),
|(mut other_receive_collect, mut other_group_code), (group_code, receives)| {
if let Some(instance_list) = instance_group_code.get_mut(&group_code) {
if !instance_list.is_empty() {
for r in receives {
other_receive_collect.entry(r.receive_kind).or_insert(Vec::new()).extend(r.receive_ids)
}
for i in instance_list {
other_group_code.insert(i.rel_reach_channel);
let other_receive_collect = receive_group_code.into_iter().fold(HashMap::new(), |mut other_receive_collect, (group_code, receives)| {
if let Some(instance_list) = instance_group_code.get_mut(&group_code) {
if !instance_list.is_empty() {
for i in instance_list {
for r in &receives {
other_receive_collect.entry((r.receive_kind, i.rel_reach_channel)).or_insert(Vec::new()).extend(r.receive_ids.clone())
}
}
}
(other_receive_collect, other_group_code)
},
);
}
other_receive_collect
});
// let (other_receive_collect, other_group_code) = receive_group_code.into_iter().fold(
// (HashMap::new(), HashSet::new()),
// |(mut other_receive_collect, mut other_group_code), (group_code, receives)| {
// if let Some(instance_list) = instance_group_code.get_mut(&group_code) {
// if !instance_list.is_empty() {
// for r in receives {
// other_receive_collect.entry(r.receive_kind).or_insert(Vec::new()).extend(r.receive_ids)
// }
// for i in instance_list {
// other_group_code.insert(i.rel_reach_channel);
// }
// }
// }
// (other_receive_collect, other_group_code)
// },
// );

for (_kind, gc) in global_configs {
for (receive_kind, to_res_ids) in &other_receive_collect {
if other_group_code.contains(&gc.rel_reach_channel) && !gc.rel_reach_msg_signature_id.is_empty() && !gc.rel_reach_msg_template_id.is_empty() {
for ((receive_kind, rel_reach_channel), to_res_ids) in &other_receive_collect {
if rel_reach_channel == &gc.rel_reach_channel && !gc.rel_reach_msg_signature_id.is_empty() && !gc.rel_reach_msg_template_id.is_empty() {
ReachMessageServ::add_rbum(
&mut ReachMessageAddReq {
rbum_item_add_req: RbumItemAddReq {
Expand Down

0 comments on commit 5c2348f

Please sign in to comment.