SUPPORT-9368: proto file
This commit is contained in:
parent
fbd25050f0
commit
a7556b0af5
3 changed files with 23 additions and 9 deletions
|
|
@ -4,7 +4,7 @@ import java.net.URLEncoder;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.kafka.shaded.com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.ByteString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
package ru.micord.ervu.model;
|
||||
|
||||
import org.apache.kafka.shaded.com.google.protobuf.ByteString;
|
||||
import org.apache.kafka.shaded.com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import rtl.pgs.ervu.lkrp.journal.proto.ResponseData;
|
||||
|
||||
|
||||
public class ValidateExportResponse {
|
||||
private String fileName;
|
||||
private ByteString file;
|
||||
private final String fileName;
|
||||
private final ByteString file;
|
||||
|
||||
public ValidateExportResponse(byte[] bytes) throws InvalidProtocolBufferException {
|
||||
// TODO: Заменить ValidateExportResponseProto на реальный protobuf класс
|
||||
// ValidateExportResponseProto protoResponse = ValidateExportResponseProto.parseFrom(bytes);
|
||||
// this.fileName = protoResponse.getFileName();
|
||||
// this.file = protoResponse.getFile();
|
||||
ResponseData responseData = ResponseData.parseFrom(bytes);
|
||||
fileName = responseData.getFileName();
|
||||
file = responseData.getFile();
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
|
|
|
|||
13
backend/src/main/resources/ProtoResponseData.proto
Normal file
13
backend/src/main/resources/ProtoResponseData.proto
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package rtl.pgs.ervu.lkrp.journal;
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "LkrpResponse";
|
||||
option java_package = "rtl.pgs.ervu.lkrp.journal.proto";
|
||||
|
||||
message ResponseData {
|
||||
string fileName = 1;
|
||||
bytes file = 2;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue