Skip to content

Commit

Permalink
Arrange file
Browse files Browse the repository at this point in the history
  • Loading branch information
j03-dev committed Oct 14, 2023
1 parent fd9b823 commit de4c4c4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
11 changes: 1 addition & 10 deletions src/response_models/generic.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use super::{payload::Payload, Recipient, SendResponse};
use rocket::serde::Serialize;

use super::{
payload::Payload,
SendResponse,
};

#[derive(Serialize)]
pub struct GenericButton<'b> {
#[serde(rename = "type")]
Expand Down Expand Up @@ -49,11 +45,6 @@ struct GenericMessage<'m> {
pub attachment: Attachment<'m>,
}

#[derive(Serialize)]
pub struct Recipient<'r> {
pub id: &'r str,
}

#[derive(Serialize)]
pub struct GenericModel<'g> {
recipient: Recipient<'g>,
Expand Down
2 changes: 1 addition & 1 deletion src/response_models/media.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rocket::serde::Serialize;

use super::{generic::Recipient, SendResponse};
use super::{Recipient, SendResponse};

#[derive(Serialize)]
struct MediaPayload<'p> {
Expand Down
7 changes: 6 additions & 1 deletion src/response_models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ use dotenv::dotenv;
use rocket::serde::Serialize;
use std::env;

pub mod payload;
pub mod generic;
pub mod media;
pub mod payload;
pub mod quick_replies;
pub mod text;

#[derive(Serialize)]
pub struct Recipient<'r> {
pub id: &'r str,
}

#[rocket::async_trait]
pub trait SendResponse: Serialize {
async fn send(&self) -> Result<reqwest::Response, reqwest::Error> {
Expand Down
2 changes: 1 addition & 1 deletion src/response_models/quick_replies.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rocket::serde::Serialize;

use super::{generic::Recipient, payload::Payload, SendResponse};
use super::{payload::Payload, Recipient, SendResponse};

#[derive(Serialize)]
pub struct QuickReplie<'r> {
Expand Down
2 changes: 1 addition & 1 deletion src/response_models/text.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rocket::serde::Serialize;

use super::{generic::Recipient, SendResponse};
use super::{Recipient, SendResponse};

#[derive(Serialize)]
pub struct Text<'t> {
Expand Down

0 comments on commit de4c4c4

Please sign in to comment.