appslib/store/
scene_store.rs1use common::store:: get;
2use uuid::Uuid;
3
4use crate::dto::scene_response::SceneResponse;
5
6const DOMAIN: &str = "apps";
7const CLUSTER: &str = "devapi.webschool.au";
8const SUFFIX: &str = "";
9
10pub struct SceneStore {}
11
12impl SceneStore {
13 pub async fn build_ws_link(project: impl Into<String>, url: impl Into<String>) -> String {
14 format!("{}://{}{}{}{}", "https", project.into(), SUFFIX, CLUSTER, url.into())
15 }
16 pub async fn get_by_id(id: Uuid) -> Result<SceneResponse, String> {
17 get::<SceneResponse>(Self::build_ws_link(DOMAIN, format!("/scene/{}", id)).await).await
18 }
19}