-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from Enraged-Dun-Cookie-Development-Team/feat…
…/union-version 统一版本接口
- Loading branch information
Showing
173 changed files
with
3,024 additions
and
240 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
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
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
20 changes: 20 additions & 0 deletions
20
http_service/ceobe_operation/release_version_service/Cargo.toml
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,20 @@ | ||
[package] | ||
name = "release_version_service" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
persistence = { workspace = true, features = ["model-ceobe-operate", "help-crates"] } | ||
semver = "1.0.23" | ||
serve_utils = { version = "0.1.0", path = "../../../libs/serve_utils" } | ||
serde = { version = "1.0.201", features = ["derive"] } | ||
thiserror.workspace = true | ||
status-err.workspace = true | ||
http.workspace = true | ||
axum-resp-result.workspace = true | ||
tracing.workspace = true | ||
serde_json.workspace = true | ||
tencent-cloud-server.workspace = true | ||
checker = { version = "0.1.0", path = "../../../libs/checker" } | ||
page_size.workspace = true | ||
ceobe_operation_logic = { version = "0.1.0", path = "../../../logic/ceobe_operation_logic" } |
23 changes: 23 additions & 0 deletions
23
http_service/ceobe_operation/release_version_service/src/error.rs
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,23 @@ | ||
use checker::prefabs::num_check::NonZeroUnsignedError; | ||
use serve_utils::{ | ||
axum::extract::rejection::{JsonRejection, QueryRejection}, | ||
status_err::StatusErr, | ||
ControllerError, ThisError, | ||
}; | ||
|
||
#[derive(Debug, ThisError, StatusErr)] | ||
#[status_err(resp_err)] | ||
pub enum Error { | ||
#[error(transparent)] | ||
Query(#[from] QueryRejection), | ||
#[error(transparent)] | ||
Json(#[from] JsonRejection), | ||
#[error(transparent)] | ||
InvalidPaginator(#[from] NonZeroUnsignedError), | ||
#[error(transparent)] | ||
Logic(#[from] ceobe_operation_logic::release_version::Error), | ||
} | ||
|
||
impl ControllerError for crate::ReleaseVersionController { | ||
type Error = Error; | ||
} |
49 changes: 49 additions & 0 deletions
49
http_service/ceobe_operation/release_version_service/src/handlers.rs
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,49 @@ | ||
use persistence::operate::FromRef; | ||
use serve_utils::{ | ||
axum::{ | ||
routing::{get, post}, | ||
Router, | ||
}, | ||
endpoint::{AdminEnd, CDN}, | ||
ControllerRoute, HandlerMapReject, HandlerResult, | ||
}; | ||
use tencent_cloud_server::axum_starter::{ | ||
PartTencentCloudManagerState, RequestClient, | ||
}; | ||
|
||
mod admin_end; | ||
mod cdn; | ||
|
||
pub(crate) type Result<T> = HandlerResult<T, crate::ReleaseVersionController>; | ||
pub(crate) type MapRejecter<T> = | ||
HandlerMapReject<T, crate::ReleaseVersionController>; | ||
|
||
impl<S> ControllerRoute<S, CDN> for crate::ReleaseVersionController | ||
where | ||
S: Send + Clone + Sync + 'static, | ||
PartTencentCloudManagerState: FromRef<S>, | ||
RequestClient: FromRef<S>, | ||
{ | ||
const BASE_URI: &'static str = "/version"; | ||
|
||
fn route(self) -> Router<S> { | ||
Router::new().route("/fetch", get(Self::fetch_version)) | ||
} | ||
} | ||
|
||
impl<S> ControllerRoute<S, AdminEnd> for crate::ReleaseVersionController | ||
where | ||
S: Send + Clone + Sync + 'static, | ||
PartTencentCloudManagerState: FromRef<S>, | ||
RequestClient: FromRef<S>, | ||
{ | ||
const BASE_URI: &'static str = "/releaseVersion"; | ||
|
||
fn route(self) -> Router<S> { | ||
Router::new() | ||
.route("/markDelete", post(Self::make_delete_version)) | ||
.route("/create", post(Self::new_version)) | ||
.route("/all", get(Self::all_version)) | ||
.route("/modify", post(Self::modify_description)) | ||
} | ||
} |
Oops, something went wrong.