Skip to content

Commit b30460d

Browse files
committed
📝 编制了剩余需要准备的路由入口。
1 parent 11f36ee commit b30460d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2167
-170
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除地区缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_area_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现地区缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除全部公用物品缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_common_item_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现公用物品缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use crate::middlewares::ExtractAuthInfo;
2+
use anyhow::Result;
3+
use axum::{extract::Json, http::StatusCode, response::IntoResponse};
4+
5+
/// 删除标签缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_icon_tag_cache(
8+
ExtractAuthInfo(auth): ExtractAuthInfo,
9+
Json(request): Json<Vec<String>>,
10+
) -> Result<impl IntoResponse, (StatusCode, String)> {
11+
// TODO: 实现标签缓存删除逻辑
12+
Ok(())
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除全部物品缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_item_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现物品缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除全部点位缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_marker_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现点位缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除全部点位关联缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_marker_link_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现点位关联缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1-
use anyhow::Result;
1+
mod area;
2+
mod common_item;
3+
mod icon_tag;
4+
mod item;
5+
mod marker;
6+
mod marker_link;
7+
mod notice;
28

3-
use axum::Router;
9+
use anyhow::Result;
10+
use axum::{
11+
routing::delete,
12+
Router,
13+
};
414

515
pub async fn router() -> Result<Router> {
6-
let ret = Router::new();
16+
let ret = Router::new()
17+
.route("/icon_tag", delete(icon_tag::delete_icon_tag_cache))
18+
.route("/area", delete(area::delete_area_cache))
19+
.route("/item", delete(item::delete_item_cache))
20+
.route("/common_item", delete(common_item::delete_common_item_cache))
21+
.route("/marker", delete(marker::delete_marker_cache))
22+
.route("/marker_link", delete(marker_link::delete_marker_link_cache))
23+
.route("/notice", delete(notice::delete_notice_cache));
724

825
Ok(ret)
926
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use anyhow::Result;
2+
use axum::{http::StatusCode, response::IntoResponse};
3+
use crate::middlewares::ExtractAuthInfo;
4+
5+
/// 删除公告缓存
6+
#[tracing::instrument(skip_all)]
7+
pub async fn delete_notice_cache(ExtractAuthInfo(auth): ExtractAuthInfo) -> Result<impl IntoResponse, (StatusCode, String)> {
8+
// TODO: 实现公告缓存删除逻辑
9+
Ok(())
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use anyhow::Result;
2+
use axum::{extract::Json, http::StatusCode, response::IntoResponse};
3+
4+
use crate::middlewares::ExtractAuthInfo;
5+
use _utils::models::history::HistoryListRequest;
6+
7+
/// 历史记录分页查询
8+
/// POST /history/get/list
9+
#[tracing::instrument(skip_all)]
10+
pub async fn get_list(
11+
ExtractAuthInfo(auth): ExtractAuthInfo,
12+
Json(payload): Json<HistoryListRequest>,
13+
) -> Result<impl IntoResponse, (StatusCode, String)> {
14+
// TODO: 实现历史记录分页查询的逻辑
15+
Ok(())
16+
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
use anyhow::Result;
1+
mod list;
22

3-
use axum::Router;
3+
use anyhow::Result;
4+
use axum::{routing::post, Router};
45

56
pub async fn router() -> Result<Router> {
6-
let ret = Router::new();
7+
let ret = Router::new().route("/get/list", post(list::get_list));
78

89
Ok(ret)
910
}

0 commit comments

Comments
 (0)