-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
use axum::{Json, Router}; | ||
use axum::extract::{Path, Query}; | ||
use axum::http::StatusCode; | ||
use serde::Deserialize; | ||
|
||
use crate::server::chapi_model::CodeDataStruct; | ||
|
||
pub fn router() -> Router { | ||
use axum::routing::*; | ||
|
||
Router::new() | ||
// .route("/:systemId/reporting/class-items", post(save_class_items)) | ||
// .route("/:systemId/reporting/container-services", post(save_container)) | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct ArchGuardParams { | ||
language: String, | ||
path: String, | ||
} | ||
|
||
// | ||
// pub async fn save_class_items( | ||
// Path(systemId): Path<u32>, | ||
// params: Query<ArchGuardParams>, | ||
// inputs: Vec<CodeDataStruct>, | ||
// ) -> (StatusCode, Json<()>) { | ||
// println!("systemId: {}", systemId); | ||
// println!("inputs: {}", serde_json::to_value(&inputs).unwrap()); | ||
// println!("save_class_items"); | ||
// | ||
// (StatusCode::CREATED, Json(())) | ||
// } | ||
// | ||
// pub async fn save_container( | ||
// Path(systemId): Path<u32>, | ||
// params: Query<ArchGuardParams>, | ||
// inputs: Vec<ContainerServiceDto>, | ||
// ) -> (StatusCode, Json<()>) { | ||
// println!("save_container"); | ||
// | ||
// (StatusCode::CREATED, Json(())) | ||
// } | ||
|
||
#[derive(Deserialize)] | ||
pub struct ContainerServiceDto { | ||
name: String, | ||
demands: Vec<ContainerDemand>, | ||
resources: Vec<ContainerSupply>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct ContainerSupply { | ||
source_url: String, | ||
source_http_method: String, | ||
package_name: String, | ||
class_name: String, | ||
method_name: String, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct ContainerDemand { | ||
source_caller: String, | ||
call_routes: Vec<String>, | ||
base: String, | ||
target_url: String, | ||
target_http_method: String, | ||
call_data: String, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod embedding_api; | ||
pub mod translate_api; | ||
pub mod datamap_api; | ||
pub mod archguard; | ||
pub mod archguard_api; | ||
pub mod chapi_model; | ||
|