user can adjust data with versioning from now on

This commit is contained in:
Priec
2026-07-07 23:50:44 +02:00
parent 80a61eebc6
commit 2688776f52
4 changed files with 134 additions and 1 deletions

View File

@@ -34,6 +34,32 @@ pub struct SaveGeneratedPrintJsonResponse {
#[prost(int32, tag = "3")]
pub version_number: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SaveUserAdjustedPrintJsonRequest {
#[prost(int64, tag = "1")]
pub document_run_id: i64,
#[prost(int64, optional, tag = "2")]
pub schema_id: ::core::option::Option<i64>,
#[prost(message, repeated, tag = "3")]
pub source_records: ::prost::alloc::vec::Vec<SourceRecord>,
#[prost(string, optional, tag = "4")]
pub template_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub template_kind: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub template_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "7")]
pub data_json: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SaveUserAdjustedPrintJsonResponse {
#[prost(int64, tag = "1")]
pub document_run_id: i64,
#[prost(int64, tag = "2")]
pub snapshot_id: i64,
#[prost(int32, tag = "3")]
pub version_number: i32,
}
/// Generated client implementations.
pub mod document_data_service_client {
#![allow(
@@ -154,6 +180,35 @@ pub mod document_data_service_client {
);
self.inner.unary(req, path, codec).await
}
pub async fn save_user_adjusted_print_json(
&mut self,
request: impl tonic::IntoRequest<super::SaveUserAdjustedPrintJsonRequest>,
) -> std::result::Result<
tonic::Response<super::SaveUserAdjustedPrintJsonResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.document_data.DocumentDataService/SaveUserAdjustedPrintJson",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.document_data.DocumentDataService",
"SaveUserAdjustedPrintJson",
),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
@@ -176,6 +231,13 @@ pub mod document_data_service_server {
tonic::Response<super::SaveGeneratedPrintJsonResponse>,
tonic::Status,
>;
async fn save_user_adjusted_print_json(
&self,
request: tonic::Request<super::SaveUserAdjustedPrintJsonRequest>,
) -> std::result::Result<
tonic::Response<super::SaveUserAdjustedPrintJsonResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct DocumentDataServiceServer<T> {
@@ -302,6 +364,60 @@ pub mod document_data_service_server {
};
Box::pin(fut)
}
"/komp_ac.document_data.DocumentDataService/SaveUserAdjustedPrintJson" => {
#[allow(non_camel_case_types)]
struct SaveUserAdjustedPrintJsonSvc<T: DocumentDataService>(
pub Arc<T>,
);
impl<
T: DocumentDataService,
> tonic::server::UnaryService<
super::SaveUserAdjustedPrintJsonRequest,
> for SaveUserAdjustedPrintJsonSvc<T> {
type Response = super::SaveUserAdjustedPrintJsonResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::SaveUserAdjustedPrintJsonRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DocumentDataService>::save_user_adjusted_print_json(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SaveUserAdjustedPrintJsonSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(