use crate::error::Result;
use crate::http::{BaseClient, RequestOptions};
use crate::models::{DailyRankingRequest, DailyRankingResponse, PhaseRanking, PhaseRankingRequest};
const PATH_GET_DAILY_RANKING: &str = "/dceapi/forward/publicweb/dailystat/memberDealPosi";
const PATH_GET_PHASE_RANKING: &str = "/dceapi/forward/publicweb/phasestat/memberDealCh";
#[derive(Debug, Clone)]
pub struct MemberService {
client: BaseClient,
}
impl MemberService {
pub fn new(client: BaseClient) -> Self {
MemberService { client }
}
pub async fn get_daily_ranking(
&self,
req: &DailyRankingRequest,
opts: Option<RequestOptions>,
) -> Result<DailyRankingResponse> {
self.client.do_post(PATH_GET_DAILY_RANKING, req, opts).await
}
pub async fn get_phase_ranking(
&self,
req: &PhaseRankingRequest,
opts: Option<RequestOptions>,
) -> Result<Vec<PhaseRanking>> {
self.client.do_post(PATH_GET_PHASE_RANKING, req, opts).await
}
}