Refactor handlers and OpenAPI documentation for improved readability and consistency
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 6m49s
test / unit (pull_request) Successful in 16m24s
test / integration (pull_request) Failing after 17m7s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 6m49s
test / unit (pull_request) Successful in 16m24s
test / integration (pull_request) Failing after 17m7s
- Reorganized imports in health, notifications, social, thoughts, and users handlers for clarity. - Updated function signatures in handlers to improve readability by aligning parameters. - Enhanced JSON response formatting in notifications and thoughts handlers. - Improved error handling in user-related functions. - Refactored OpenAPI documentation to maintain consistent formatting and structure. - Cleaned up unnecessary code and comments across various files. - Ensured consistent use of `Arc` for shared state in AppState and WorkerHandlers.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::value_objects::{BoostId, LikeId, ThoughtId, UserId};
|
||||
use chrono::{DateTime, Utc};
|
||||
use crate::value_objects::{UserId, ThoughtId, LikeId, BoostId};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Like {
|
||||
@@ -20,13 +20,25 @@ pub struct Boost {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum FollowState { Pending, Accepted, Rejected }
|
||||
pub enum FollowState {
|
||||
Pending,
|
||||
Accepted,
|
||||
Rejected,
|
||||
}
|
||||
impl FollowState {
|
||||
pub fn from_str(s: &str) -> Self {
|
||||
match s { "pending" => Self::Pending, "rejected" => Self::Rejected, _ => Self::Accepted }
|
||||
match s {
|
||||
"pending" => Self::Pending,
|
||||
"rejected" => Self::Rejected,
|
||||
_ => Self::Accepted,
|
||||
}
|
||||
}
|
||||
pub fn as_str(&self) -> &str {
|
||||
match self { Self::Pending => "pending", Self::Accepted => "accepted", Self::Rejected => "rejected" }
|
||||
match self {
|
||||
Self::Pending => "pending",
|
||||
Self::Accepted => "accepted",
|
||||
Self::Rejected => "rejected",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user