INNER CODE UNIT · Rust

client_account

zly2006/zhihu-plus-plus · aigc-vote-server/src/lib.rs:422

    fn client_account(&self, client_id: &str) -> Result<ClientAccount, ServiceError> {
        self.clients
            .get(client_id)
            .map(|client| client.account)
            .ok_or_else(|| ServiceError::internal("client account missing"))
    }

    fn flag_count(&self, content_type: &str, content_id: &str) -> i64 {
        self.flags
            .keys()
            .filter(|key| key.content_type == content_type && key.content_id == content_id)
            .count() as i64
    }

    fn current_version_flag_count(
        &self,
        content_type: &str,
        content_id: &str,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…