appslib/store/
scene_store.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use common::store:: get;
use uuid::Uuid;

use crate::dto::scene_response::SceneResponse;

const DOMAIN: &str = "apps";
const CLUSTER: &str = "devapi.webschool.au";
const SUFFIX: &str = "";

pub struct SceneStore {}

impl SceneStore {
    pub async fn build_ws_link(project: impl Into<String>, url: impl Into<String>) -> String {
        format!("{}://{}{}{}{}", "https", project.into(), SUFFIX, CLUSTER, url.into())
    }
    pub async fn get_by_id(id: Uuid) -> Result<SceneResponse, String> {
        get::<SceneResponse>(Self::build_ws_link(DOMAIN, format!("/scene/{}", id)).await).await
    }
}