-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODBULKOPS-249 - MARC Instance - Confirmation screen (MarcInstanceUpd…
…ateProcessor) (#263)
- Loading branch information
1 parent
8f75807
commit 37dc6ff
Showing
58 changed files
with
1,216 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 16 additions & 3 deletions
19
src/main/java/org/folio/bulkops/client/DataImportClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
package org.folio.bulkops.client; | ||
|
||
import io.swagger.v3.oas.annotations.parameters.RequestBody; | ||
import org.folio.bulkops.configs.FeignClientConfiguration; | ||
import org.folio.bulkops.domain.bean.AssembleStorageFileRequestBody; | ||
import org.folio.bulkops.domain.bean.SplitStatus; | ||
import org.folio.bulkops.domain.bean.UploadFileDefinition; | ||
import org.folio.bulkops.domain.bean.UploadFileDefinitionProcessFiles; | ||
import org.folio.bulkops.domain.bean.UploadUrlResponse; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = "data-import", configuration = FeignClientConfiguration.class) | ||
public interface DataImportClient { | ||
@GetMapping(value = "/splitStatus", produces = MediaType.APPLICATION_JSON_VALUE) | ||
SplitStatus getSplitStatus(); | ||
|
||
@GetMapping(value = "/uploadUrl", produces = MediaType.APPLICATION_JSON_VALUE) | ||
UploadUrlResponse getUploadUrl(@RequestParam("filename") String filename); | ||
|
||
@PostMapping(value = "/uploadDefinitions", produces = MediaType.APPLICATION_JSON_VALUE) | ||
UploadFileDefinition uploadFileDefinitions(@RequestBody UploadFileDefinition uploadFileDefinition); | ||
|
||
@PostMapping(value = "/uploadDefinitions/{uploadDefinitionId}/files/{fileId}") | ||
void uploadFileDefinitionsFiles(@RequestBody UploadFileDefinition uploadFileDefinition, @PathVariable String uploadDefinitionId, @PathVariable String fileId); | ||
@GetMapping(value = "/uploadDefinitions/{uploadDefinitionId}", produces = MediaType.APPLICATION_JSON_VALUE) | ||
UploadFileDefinition getUploadDefinitionById(@PathVariable String uploadDefinitionId); | ||
|
||
@PostMapping(value = "/uploadDefinitions/{uploadDefinitionId}/processFiles") | ||
void uploadFileDefinitionsProcessFiles(@RequestBody UploadFileDefinitionProcessFiles uploadFileDefinitionProcessFiles, @PathVariable String uploadDefinitionId); | ||
|
||
@PostMapping(value = "/uploadDefinitions/{uploadDefinitionId}/files/{fileId}/assembleStorageFile") | ||
void assembleStorageFile(@PathVariable String uploadDefinitionId, @PathVariable String fileId, @RequestBody AssembleStorageFileRequestBody body); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/org/folio/bulkops/client/DataImportRestS3UploadClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.folio.bulkops.client; | ||
|
||
import org.springframework.http.HttpEntity; | ||
import org.springframework.http.HttpMethod; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
import java.net.URI; | ||
|
||
@Component | ||
public class DataImportRestS3UploadClient { | ||
public ResponseEntity<String> uploadFile(String presignedUrl, byte[] fileContent) { | ||
return new RestTemplate().exchange(URI.create(presignedUrl), HttpMethod.PUT, new HttpEntity<>(fileContent), String.class); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/org/folio/bulkops/client/DataImportUploadClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.folio.bulkops.client; | ||
|
||
import org.folio.bulkops.configs.DataImportFeignConfig; | ||
import org.folio.bulkops.domain.bean.UploadFileDefinition; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
@FeignClient(name = "data-import-upload", url = "http://data-import", configuration = DataImportFeignConfig.class) | ||
public interface DataImportUploadClient { | ||
|
||
@PostMapping(value = "/uploadDefinitions/{uploadDefinitionId}/files/{fileId}", | ||
consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE, | ||
headers = {"Content-Type: application/octet-stream"}) | ||
UploadFileDefinition uploadFileDefinitionsFiles(@PathVariable String uploadDefinitionId, @PathVariable String fileId, @RequestBody byte[] bytes); | ||
|
||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/org/folio/bulkops/client/MetadataProviderClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/org/folio/bulkops/configs/DataImportFeignConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.folio.bulkops.configs; | ||
|
||
import feign.codec.Encoder; | ||
import feign.form.FormEncoder; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
public class DataImportFeignConfig { | ||
@Bean | ||
public Encoder feignEncoder() { | ||
return new FormEncoder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/org/folio/bulkops/domain/bean/AssembleStorageFileRequestBody.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.folio.bulkops.domain.bean; | ||
|
||
import java.util.List; | ||
|
||
public record AssembleStorageFileRequestBody(String uploadId, String key, List<String> tags) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/org/folio/bulkops/domain/bean/SplitStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.folio.bulkops.domain.bean; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SplitStatus { | ||
|
||
@JsonProperty("splitStatus") | ||
private Boolean splitStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/org/folio/bulkops/domain/bean/UploadUrlResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.folio.bulkops.domain.bean; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class UploadUrlResponse { | ||
@JsonProperty("url") | ||
private String url; | ||
|
||
@JsonProperty("key") | ||
private String key; | ||
|
||
@JsonProperty("uploadId") | ||
private String uploadId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.