user can adjust data with versioning from now on
This commit is contained in:
2
client
2
client
Submodule client updated: 3bce44d145...25c132a2b1
@@ -3,6 +3,7 @@ package komp_ac.document_data;
|
||||
|
||||
service DocumentDataService {
|
||||
rpc SaveGeneratedPrintJson(SaveGeneratedPrintJsonRequest) returns (SaveGeneratedPrintJsonResponse);
|
||||
rpc SaveUserAdjustedPrintJson(SaveUserAdjustedPrintJsonRequest) returns (SaveUserAdjustedPrintJsonResponse);
|
||||
}
|
||||
|
||||
message SourceRecord {
|
||||
@@ -26,3 +27,19 @@ message SaveGeneratedPrintJsonResponse {
|
||||
int64 snapshot_id = 2;
|
||||
int32 version_number = 3;
|
||||
}
|
||||
|
||||
message SaveUserAdjustedPrintJsonRequest {
|
||||
int64 document_run_id = 1;
|
||||
optional int64 schema_id = 2;
|
||||
repeated SourceRecord source_records = 3;
|
||||
optional string template_name = 4;
|
||||
optional string template_kind = 5;
|
||||
optional string template_path = 6;
|
||||
string data_json = 7;
|
||||
}
|
||||
|
||||
message SaveUserAdjustedPrintJsonResponse {
|
||||
int64 document_run_id = 1;
|
||||
int64 snapshot_id = 2;
|
||||
int32 version_number = 3;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user