-
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
vsilent
committed
Sep 3, 2023
1 parent
374d906
commit 521cafc
Showing
4 changed files
with
40 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
# stacker | ||
# stacker | ||
|
||
|
||
Run db migration | ||
``` | ||
sqlx migrate run | ||
``` | ||
|
||
Down migration | ||
|
||
``` | ||
sqlx migrate revert | ||
``` | ||
|
||
|
||
Add rating | ||
|
||
``` | ||
curl -vX POST 'http://localhost:8000/rating' -d '{"obj_id": 111, "category": "application", "comment":"some comment", "rate": 10}' --header 'Content-Type: application/json' | ||
``` |
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,10 +1,5 @@ | ||
mod get_stack; | ||
mod health_checks; | ||
// mod add_stack; | ||
// mod deploy; | ||
mod rating; | ||
|
||
// pub use get_stack::*; | ||
pub use health_checks::*; | ||
// pub use add_stack::*; | ||
// crate::routes:: | ||
pub use rating::*; |
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,10 +1,21 @@ | ||
use actix_web::HttpResponse; | ||
use actix_web::{web, HttpResponse}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
|
||
// workflow | ||
// add, update, list, get(user_id), ACL, | ||
// ACL - access to func for a user | ||
// ACL - access to objects for a user | ||
|
||
pub async fn rating() -> HttpResponse { | ||
unimplemented!() | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct RatingForm { | ||
pub obj_id: u32, // product external id | ||
pub category: String, // rating of product | rating of service etc | ||
pub comment: String, // always linked to a product | ||
pub rate: u32, // | ||
} | ||
|
||
pub async fn rating(form: web::Json<RatingForm>) -> HttpResponse { | ||
println!("{:?}", form); | ||
HttpResponse::Ok().finish() | ||
} |
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