Skip to content

Commit 79e1e4c

Browse files
committed
creating pages
1 parent 2649549 commit 79e1e4c

File tree

6 files changed

+26
-5
lines changed

6 files changed

+26
-5
lines changed

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
mod pages;
22
mod helpers;
3-
mod models;
3+
mod model;
4+
mod spaces;
45

56
use std::fmt::format;
67
use std::future::Future;
78
use std::iter::Map;
89
use reqwest::{Body, Error};
910
use serde_json::{json, Value};
1011
use tokio::time::Instant;
11-
use crate::models::models::{Ancestor, CreatePage, CreatePageSpace, PageBody, Storage};
12+
use crate::model::models::{Ancestor, CreatePage, CreatePageSpace, PageBody, Storage};
1213
use crate::pages::page_service::{create_page, get_page};
1314

1415

src/models.rs renamed to src/model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod models {
55
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
66
#[allow(non_snake_case)]
77
pub struct Extentions {
8-
// #[serde(skip_serializing_if = "String::is_empty")]
8+
#[serde(skip_serializing_if = "String::is_empty")]
99
position: i32,
1010
}
1111

@@ -160,7 +160,7 @@ pub mod models {
160160
}
161161

162162
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
163-
#[serde(rename_all = "camelCase")]
163+
// #[serde(rename_all = "camelCase")]
164164
pub struct CntHistory {
165165
pub latest: bool,
166166
pub created_by: CreatedBy,
File renamed without changes.
File renamed without changes.

src/pages.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pub mod page_service {
22
use reqwest::Response;
3-
use crate::models::models::{Content, CreatePage};
3+
use crate::model::models::{Content, CreatePage};
44

55
pub async fn get_page(url: &str, token: String, id: String) -> Content {
66
let request_url = format!("{url}/rest/api/content/{id}");
@@ -27,6 +27,16 @@ pub mod page_service {
2727
return created;
2828
}
2929

30+
// todo
31+
pub async fn copy_page(conf_url: &str, token: &str, page: CreatePage) -> String {
32+
return String::from("");
33+
}
34+
// todo
35+
pub async fn move_page(conf_url: &str, token: &str, page: CreatePage) -> String {
36+
return String::from("");
37+
}
38+
39+
3040

3141

3242

src/spaces.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pub mod spaces {
2+
3+
pub async fn get_space() {
4+
5+
}
6+
7+
pub async fn create_space() {
8+
9+
}
10+
}

0 commit comments

Comments
 (0)