Compare commits
No commits in common. "eb56af74e6a4914884a98a449c2afcc176bc0e13" and "99d760729409c19f852ba694b32f0a422d37a0ca" have entirely different histories.
eb56af74e6
...
99d7607294
2 changed files with 10 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
||||||
use crate::AppState;
|
use std::os::linux::raw::stat;
|
||||||
use actix_web::{error::ErrorInternalServerError, web, HttpResponse, Responder};
|
use actix_web::{error::ErrorInternalServerError, http::header::ACCEPT, web, HttpResponse, Responder};
|
||||||
use entity::node_group;
|
use entity::node_group;
|
||||||
use sea_orm::{ActiveModelTrait, ActiveValue, EntityTrait};
|
use sea_orm::{ActiveModelTrait, ActiveValue, EntityTrait, IntoActiveModel};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
use crate::AppState;
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct CreateGroupWithoutId {
|
pub struct CreateGroupWithoutId {
|
||||||
|
@ -112,4 +113,4 @@ pub async fn delete_node(
|
||||||
.map_err(ErrorInternalServerError)?;
|
.map_err(ErrorInternalServerError)?;
|
||||||
|
|
||||||
Ok(HttpResponse::Ok().finish())
|
Ok(HttpResponse::Ok().finish())
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::controller::{node, user};
|
use crate::controller::{node, user};
|
||||||
use actix_web::web::{self};
|
use actix_web::web::{self, route, service};
|
||||||
|
|
||||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
|
@ -19,7 +19,10 @@ pub fn config(cfg: &mut web::ServiceConfig) {
|
||||||
.get(node::get_nodes)
|
.get(node::get_nodes)
|
||||||
.post(node::create_node),
|
.post(node::create_node),
|
||||||
)
|
)
|
||||||
.service(web::resource("/nodes/{id}").delete(node::delete_node))
|
.service(
|
||||||
|
web::resource("/nodes/{id}")
|
||||||
|
.delete(node::delete_node)
|
||||||
|
)
|
||||||
.service(web::resource("/groups").post(node::create_group)),
|
.service(web::resource("/groups").post(node::create_group)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue