dceapi_rs/services/
member.rs1use crate::error::Result;
4use crate::http::{BaseClient, RequestOptions};
5use crate::models::{DailyRankingRequest, DailyRankingResponse, PhaseRanking, PhaseRankingRequest};
6
7const PATH_GET_DAILY_RANKING: &str = "/dceapi/forward/publicweb/dailystat/memberDealPosi";
9
10const PATH_GET_PHASE_RANKING: &str = "/dceapi/forward/publicweb/phasestat/memberDealCh";
12
13#[derive(Debug, Clone)]
15pub struct MemberService {
16 client: BaseClient,
17}
18
19impl MemberService {
20 pub fn new(client: BaseClient) -> Self {
22 MemberService { client }
23 }
24
25 pub async fn get_daily_ranking(
33 &self,
34 req: &DailyRankingRequest,
35 opts: Option<RequestOptions>,
36 ) -> Result<DailyRankingResponse> {
37 self.client.do_post(PATH_GET_DAILY_RANKING, req, opts).await
38 }
39
40 pub async fn get_phase_ranking(
48 &self,
49 req: &PhaseRankingRequest,
50 opts: Option<RequestOptions>,
51 ) -> Result<Vec<PhaseRanking>> {
52 self.client.do_post(PATH_GET_PHASE_RANKING, req, opts).await
53 }
54}