-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import from descriptor now supports dependencies #124
- Loading branch information
tillias
committed
Jan 15, 2021
1 parent
d9cbb22
commit 74a80cc
Showing
3 changed files
with
91 additions
and
11 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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/github/microcatalog/web/rest/custom/ImportResource.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,28 @@ | ||
package com.github.microcatalog.web.rest.custom; | ||
|
||
import com.github.microcatalog.service.custom.ImportService; | ||
import com.github.microcatalog.service.dto.custom.FullMicroserviceDto; | ||
import com.github.microcatalog.service.dto.custom.MicroserviceImportDescriptorDto; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* REST controller for importing {@link com.github.microcatalog.domain.Microservice} with {@link com.github.microcatalog.domain.Dependency} | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class ImportResource { | ||
private final ImportService importService; | ||
|
||
public ImportResource(ImportService importService) { | ||
this.importService = importService; | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity<FullMicroserviceDto> importMicroservice(@RequestBody MicroserviceImportDescriptorDto descriptor) { | ||
return ResponseEntity.of(importService.importFromDescriptor(descriptor)); | ||
} | ||
} |
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