-
Notifications
You must be signed in to change notification settings - Fork 0
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
12 changed files
with
2,305 additions
and
44 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 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
Binary file not shown.
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
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
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,25 @@ | ||
use serde::Deserialize; | ||
use validator::Validate; | ||
|
||
use crate::model::sea_orm_active_enums::CommentStatus; | ||
|
||
#[derive(Debug, Validate, Deserialize)] | ||
pub struct CommentQueryReq { | ||
pub r#type: ShowType, | ||
pub status: CommentStatus, | ||
pub owner: Owner, | ||
#[validate(length(max = 32, message = "查询关键字过长"))] | ||
pub keyword: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub enum ShowType { | ||
List, | ||
Tree, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub enum Owner { | ||
All, | ||
Mine, | ||
} |
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,2 +1,3 @@ | ||
pub mod user; | ||
pub mod view_counter; | ||
pub mod view_counter; | ||
pub mod comment; |
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,7 +1,17 @@ | ||
use crate::dto::comment::CommentQueryReq; | ||
use sea_orm::TransactionTrait; | ||
use spring_sea_orm::DbConn; | ||
use spring_web::{axum::response::IntoResponse, error::Result, extractor::Component, get}; | ||
use spring_web::{ | ||
axum::response::IntoResponse, | ||
error::Result, | ||
extractor::{Component, Query}, | ||
get, | ||
}; | ||
|
||
#[get("/comment")] | ||
async fn get_comment(Component(db): Component<DbConn>) -> Result<impl IntoResponse> { | ||
async fn get_comment( | ||
Component(db): Component<DbConn>, | ||
Query(req): Query<CommentQueryReq>, | ||
) -> Result<impl IntoResponse> { | ||
Ok("") | ||
} |
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