wechat_mp_security/
lib.rs1mod content;
4mod risk;
5
6pub use content::{
7 media_check_async, msg_sec_check, MediaCheckAsyncRequest, MediaCheckAsyncResponse,
8 MsgSecCheckRequest, MsgSecCheckResponse, MsgSecCheckResult,
9};
10pub use risk::{get_user_risk_rank, GetUserRiskRankRequest, GetUserRiskRankResponse};
11
12use wechat_mp_core::MpClient;
13
14#[derive(Clone)]
16pub struct SecurityApi {
17 client: MpClient,
18}
19
20impl SecurityApi {
21 pub fn new(client: MpClient) -> Self {
23 Self { client }
24 }
25
26 pub async fn msg_sec_check(
28 &self,
29 req: &MsgSecCheckRequest,
30 ) -> wechat_mp_core::Result<MsgSecCheckResponse> {
31 msg_sec_check(&self.client, req).await
32 }
33
34 pub async fn media_check_async(
36 &self,
37 req: &MediaCheckAsyncRequest,
38 ) -> wechat_mp_core::Result<MediaCheckAsyncResponse> {
39 media_check_async(&self.client, req).await
40 }
41
42 pub async fn get_user_risk_rank(
44 &self,
45 req: &GetUserRiskRankRequest,
46 ) -> wechat_mp_core::Result<GetUserRiskRankResponse> {
47 get_user_risk_rank(&self.client, req).await
48 }
49}