Skip to content

Commit

Permalink
Merge pull request #249 from PoulavBhowmick03/routing_change
Browse files Browse the repository at this point in the history
Updated axum_auto_routes
  • Loading branch information
Marchand-Nicolas authored Aug 25, 2024
2 parents b224caa + 6cfb5e1 commit 56e2de6
Show file tree
Hide file tree
Showing 227 changed files with 399 additions and 1,042 deletions.
3 changes: 1 addition & 2 deletions src/endpoints/achievements/batched/verify_tvl_batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/batched/verify_tvl_batched",
crate::endpoints::achievements::batched::verify_tvl_batched
"/achievements/batched/verify_tvl_batched"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/claim/quests_achievement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ fn get_number_of_quests(id: u32) -> u32 {

#[route(
get,
"/achievements/claim/quest_achievement",
crate::endpoints::achievements::claim::quests_achievement
"/achievements/claim/quest_achievement"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/fetch",
crate::endpoints::achievements::fetch
"/achievements/fetch"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/fetch_buildings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use mongodb::bson::{doc, from_document};

#[route(
get,
"/achievements/fetch_buildings",
crate::endpoints::achievements::fetch_buildings
"/achievements/fetch_buildings"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_achieved_quests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/verify_achieved_quests",
crate::endpoints::achievements::verify_achieved_quests
"/achievements/verify_achieved_quests"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_avnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/verify_avnu",
crate::endpoints::achievements::verify_avnu
"/achievements/verify_avnu"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_briq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/verify_briq",
crate::endpoints::achievements::verify_briq
"/achievements/verify_briq"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ fn get_args(config: Config, achievement_id: u32) -> Result<(FieldElement, u32, N

#[route(
get,
"/achievements/verify_default",
crate::endpoints::achievements::verify_default
"/achievements/verify_default"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
4 changes: 1 addition & 3 deletions src/endpoints/achievements/verify_has_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use std::{

#[route(
get,
"/achievements/verify_has_domain",
crate::endpoints::achievements::verify_has_domain
)]
"/achievements/verify_has_domain")]
pub async fn handler(
State(state): State<Arc<AppState>>,
Query(query): Query<VerifyQuery>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_quests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ fn get_number_of_quests(id: u32) -> u32 {

#[route(
get,
"/achievements/verify_quests",
crate::endpoints::achievements::verify_quests
"/achievements/verify_quests"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_seniority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/verify_seniority",
crate::endpoints::achievements::verify_seniority
"/achievements/verify_seniority"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/achievements/verify_tvl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use starknet::core::types::FieldElement;

#[route(
get,
"/achievements/verify_tvl",
crate::endpoints::achievements::verify_tvl
"/achievements/verify_tvl"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/balance/create_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ pub_struct!(Deserialize; CreateBalance {

#[route(
post,
"/admin/tasks/balance/create",
crate::endpoints::admin::balance::create_balance
"/admin/tasks/balance/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/balance/update_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ fn field_element_to_bson(fe: &FieldElement) -> mongodb::bson::Bson {

#[route(
post,
"/admin/tasks/balance/update",
crate::endpoints::admin::balance::update_balance
"/admin/tasks/balance/update"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/custom/create_custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ pub_struct!(Deserialize; CreateCustom {

#[route(
post,
"/admin/tasks/custom/create",
crate::endpoints::admin::custom::create_custom
"/admin/tasks/custom/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/custom/update_custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub_struct!(Deserialize; CreateCustom {
href: Option<String>,
});

#[route(post, "/admin/tasks/custom/update", crate::endpoints::admin::custom::update_custom)]
#[route(post, "/admin/tasks/custom/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/delete_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub_struct!(Deserialize; DeleteTask {
id: i32,
});

#[route(post, "/admin/tasks/remove_task", crate::endpoints::admin::delete_task)]
#[route(post, "/admin/tasks/remove_task")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/discord/create_discord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ pub_struct!(Deserialize; CreateCustom {

#[route(
post,
"/admin/tasks/discord/create",
crate::endpoints::admin::discord::create_discord
"/admin/tasks/discord/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/discord/update_discord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub_struct!(Deserialize; CreateCustom {
guild_id: Option<String>,
});

#[route(post, "/admin/tasks/discord/update", crate::endpoints::admin::discord::update_discord)]
#[route(post, "/admin/tasks/discord/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/domain/create_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ pub_struct!(Deserialize; CreateTwitterFw {

#[route(
post,
"/admin/tasks/domain/create",
crate::endpoints::admin::domain::create_domain
"/admin/tasks/domain/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/domain/update_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub_struct!(Deserialize; CreateTwitterFw {
id: i32,
});

#[route(post, "/admin/tasks/domain/update", crate::endpoints::admin::domain::update_domain)]
#[route(post, "/admin/tasks/domain/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct GetQuestsQuery {
code: String,
}

#[route(get, "/admin/login", crate::endpoints::admin::login)]
#[route(get, "/admin/login")]
pub async fn handler(
State(state): State<Arc<AppState>>,
Query(query): Query<GetQuestsQuery>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/nft_uri/create_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub_struct!(Deserialize; CreateCustom {
image: String,
});

#[route(post, "/admin/nft_uri/create", crate::endpoints::admin::nft_uri::create_uri)]
#[route(post, "/admin/nft_uri/create")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/nft_uri/get_nft_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pub struct GetQuestsQuery {

#[route(
get,
"/admin/nft_uri/get_nft_uri",
crate::endpoints::admin::nft_uri::get_nft_uri
"/admin/nft_uri/get_nft_uri"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/nft_uri/update_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub_struct!(Deserialize; CreateCustom {
image: Option<String>,
});

#[route(post, "/admin/nft_uri/update", crate::endpoints::admin::nft_uri::update_uri)]
#[route(post, "/admin/nft_uri/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quest/create_quest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ pub_struct!(Deserialize; CreateQuestQuery {

#[route(
post,
"/admin/quest/create",
crate::endpoints::admin::quest::create_quest
"/admin/quest/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quest/get_quest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ pub struct GetQuestsQuery {

#[route(
get,
"/admin/quest/get_quest",
crate::endpoints::admin::quest::get_quest
"/admin/quest/get_quest"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quest/get_quests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use std::sync::Arc;

#[route(
get,
"/admin/quest/get_quests",
crate::endpoints::admin::quest::get_quests
"/admin/quest/get_quests"
)]
pub async fn handler(State(state): State<Arc<AppState>>, headers: HeaderMap) -> impl IntoResponse {
let user = check_authorization!(headers, &state.conf.auth.secret_key.as_ref());
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/quest/get_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct GetTasksQuery {
quest_id: u32,
}

#[route(get, "/admin/quest/get_tasks", crate::endpoints::admin::quest::get_tasks)]
#[route(get, "/admin/quest/get_tasks")]
pub async fn handler(
State(state): State<Arc<AppState>>,
Query(query): Query<GetTasksQuery>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/quest/update_quest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub_struct!(Deserialize; UpdateQuestQuery {
issuer: Option<String>,
});

#[route(post, "/admin/quest/update", crate::endpoints::admin::quest::update_quest)]
#[route(post, "/admin/quest/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quest_boost/create_boost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ pub struct CreateBoostQuery {

#[route(
post,
"/admin/quest_boost/create_boost",
crate::endpoints::admin::quest_boost::create_boost
"/admin/quest_boost/create_boost"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quest_boost/update_boost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ pub_struct!(Deserialize; UpdateBoostQuery {

#[route(
post,
"/admin/quest_boost/update_boost",
crate::endpoints::admin::quest_boost::update_boost
"/admin/quest_boost/update_boost"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quiz/create_question.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub_struct!(Deserialize; CreateQuizQuestion {

#[route(
post,
"/admin/tasks/quiz/question/create",
crate::endpoints::admin::quiz::create_question
"/admin/tasks/quiz/question/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quiz/create_quiz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ pub_struct!(Deserialize; CreateQuiz {

#[route(
post,
"/admin/tasks/quiz/create",
crate::endpoints::admin::quiz::create_quiz
"/admin/tasks/quiz/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quiz/get_quiz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub struct GetQuestsQuery {

#[route(
get,
"/admin/quiz/get_quiz",
crate::endpoints::admin::quiz::get_quiz,
"/admin/quiz/get_quiz"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/quiz/update_question.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ pub_struct!(Deserialize; UpdateQuiz {

#[route(
post,
"/admin/tasks/quiz/question/update",
crate::endpoints::admin::quiz::update_question
"/admin/tasks/quiz/question/update"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/quiz/update_quiz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub_struct!(Deserialize; UpdateQuiz {
intro: Option<String>,
});

#[route(post, "/admin/tasks/quiz/update", crate::endpoints::admin::quiz::update_quiz)]
#[route(post, "/admin/tasks/quiz/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/twitter/create_twitter_fw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub_struct!(Deserialize; CreateTwitterFw {

#[route(
post,
"/admin/tasks/twitter_fw/create",
crate::endpoints::admin::twitter::create_twitter_fw
"/admin/tasks/twitter_fw/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/twitter/create_twitter_rw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub_struct!(Deserialize; CreateTwitterRw {

#[route(
post,
"/admin/tasks/twitter_rw/create",
crate::endpoints::admin::twitter::create_twitter_rw
"/admin/tasks/twitter_rw/create"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
3 changes: 1 addition & 2 deletions src/endpoints/admin/twitter/update_twitter_fw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub_struct!(Deserialize; UpdateTwitterFw {

#[route(
post,
"/admin/tasks/twitter_fw/update",
crate::endpoints::admin::twitter::update_twitter_fw
"/admin/tasks/twitter_fw/update"
)]
pub async fn handler(
State(state): State<Arc<AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/admin/twitter/update_twitter_rw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub_struct!(Deserialize; UpdateTwitterRw {
id: i32,
});

#[route(post, "/admin/tasks/twitter_rw/update", crate::endpoints::admin::twitter::update_twitter_rw)]
#[route(post, "/admin/tasks/twitter_rw/update")]
pub async fn handler(
State(state): State<Arc<AppState>>,
headers: HeaderMap,
Expand Down
Loading

0 comments on commit 56e2de6

Please sign in to comment.