-
Notifications
You must be signed in to change notification settings - Fork 1
/
user.rs
45 lines (35 loc) · 1.33 KB
/
user.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use anyhow::Result;
use dotenv::dotenv;
use tracing::debug;
use wecom_rs::{Client, UserManager};
#[tokio::main]
async fn main() -> Result<()> {
dotenv().ok();
tracing_subscriber::fmt::init();
let client = Client::new_from_env()?;
// client
// .user_create(wecom_rs::client::ParamsCreateUser::new_simple(
// "[email protected]".to_string(),
// "测试邮箱".to_string(),
// "18612424367".to_string(),
// vec![1361979], // 运维研发
// ))
// .await?;
// client
// .user_update(wecom_rs::client::ParamsUpdateUser {
// user_id: "[email protected]".to_string(),
// name: Some("测试邮箱111".to_string()),
// ..Default::default()
// })
// .await?;
let user = client.user_get("[email protected]").await?;
debug!("user_get: {}", serde_json::to_string(&user)?);
// client.user_delete("[email protected]").await?;
// let uids_delete = vec!["[email protected]"];
// client.user_batch_delete(&uids_delete).await?;
// let users = client.user_list(1361979).await?;
// debug!("user_list: {}", serde_json::to_string(&users)?);
// let user_id = client.userid_get("18612424366").await?;
// debug!("user_id: {user_id}");
Ok(())
}