mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-21 07:20:41 +00:00
refactor: removed HttpResponse completely
This commit is contained in:
@@ -11,13 +11,7 @@ use aide::axum::{ApiRouter, IntoApiResponse};
|
||||
use aide::openapi::{Info, OpenApi};
|
||||
use async_trait::async_trait;
|
||||
use axum::Extension;
|
||||
use axum::{
|
||||
error_handling::HandleErrorLayer,
|
||||
http::header,
|
||||
response::IntoResponse,
|
||||
response::{Json, Response},
|
||||
routing, BoxError, Router,
|
||||
};
|
||||
use axum::{error_handling::HandleErrorLayer, response::Json, routing, BoxError, Router};
|
||||
use common_query::Output;
|
||||
use common_recordbatch::{util, RecordBatch};
|
||||
use common_telemetry::logging::info;
|
||||
|
||||
@@ -6,7 +6,6 @@ use common_grpc::writer::Precision;
|
||||
|
||||
use crate::error::Result;
|
||||
use crate::error::TimePrecisionSnafu;
|
||||
use crate::http::HttpResponse;
|
||||
use crate::influxdb::InfluxdbRequest;
|
||||
use crate::query_handler::InfluxdbLineProtocolHandlerRef;
|
||||
|
||||
@@ -15,14 +14,14 @@ pub async fn influxdb_write(
|
||||
State(handler): State<InfluxdbLineProtocolHandlerRef>,
|
||||
Query(params): Query<HashMap<String, String>>,
|
||||
lines: String,
|
||||
) -> Result<(StatusCode, HttpResponse)> {
|
||||
) -> Result<(StatusCode, ())> {
|
||||
let precision = params
|
||||
.get("precision")
|
||||
.map(|val| parse_time_precision(val))
|
||||
.transpose()?;
|
||||
let request = InfluxdbRequest { precision, lines };
|
||||
handler.exec(&request).await?;
|
||||
Ok((StatusCode::NO_CONTENT, HttpResponse::Text("".to_string())))
|
||||
Ok((StatusCode::NO_CONTENT, ()))
|
||||
}
|
||||
|
||||
fn parse_time_precision(value: &str) -> Result<Precision> {
|
||||
|
||||
Reference in New Issue
Block a user