feat: add appflowy web url to server info endpoint (#1148)
This commit is contained in:
parent
832bd7f9c9
commit
b9f79ef9f9
|
|
@ -10,4 +10,5 @@ pub enum SupportedClientFeatures {
|
|||
pub struct ServerInfoResponseItem {
|
||||
pub supported_client_features: Vec<SupportedClientFeatures>,
|
||||
pub minimum_supported_client_version: Option<String>,
|
||||
pub appflowy_web_url: Option<String>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
use actix_web::web::Data;
|
||||
use actix_web::{web, Scope};
|
||||
use shared_entity::dto::server_info_dto::ServerInfoResponseItem;
|
||||
use shared_entity::response::{AppResponse, JsonAppResponse};
|
||||
|
||||
use crate::state::AppState;
|
||||
|
||||
pub fn server_info_scope() -> Scope {
|
||||
web::scope("/api/server").service(web::resource("").route(web::get().to(server_info_handler)))
|
||||
}
|
||||
|
||||
async fn server_info_handler() -> actix_web::Result<JsonAppResponse<ServerInfoResponseItem>> {
|
||||
async fn server_info_handler(
|
||||
state: Data<AppState>,
|
||||
) -> actix_web::Result<JsonAppResponse<ServerInfoResponseItem>> {
|
||||
Ok(
|
||||
AppResponse::Ok()
|
||||
.with_data(ServerInfoResponseItem {
|
||||
supported_client_features: vec![],
|
||||
minimum_supported_client_version: None,
|
||||
appflowy_web_url: state.config.appflowy_web_url.clone(),
|
||||
})
|
||||
.into(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue