-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added full impl workspace details endpoint (#5)
- Loading branch information
1 parent
ed592d0
commit 344511f
Showing
6 changed files
with
241 additions
and
13 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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/tkit/onecx/permission/bff/rs/mappers/WorkspaceMapper.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,14 +1,37 @@ | ||
package org.tkit.onecx.permission.bff.rs.mappers; | ||
|
||
import java.util.List; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.tkit.quarkus.rs.mappers.OffsetDateTimeMapper; | ||
|
||
import gen.org.tkit.onecx.permission.bff.rs.internal.model.ProductDTO; | ||
import gen.org.tkit.onecx.permission.bff.rs.internal.model.ProductDetailsDTO; | ||
import gen.org.tkit.onecx.permission.bff.rs.internal.model.WorkspaceDetailsDTO; | ||
import gen.org.tkit.onecx.permission.client.model.Product; | ||
import gen.org.tkit.onecx.product.store.client.model.ProductsAbstract; | ||
import gen.org.tkit.onecx.product.store.client.model.ProductsLoadResult; | ||
|
||
@Mapper(uses = { OffsetDateTimeMapper.class }) | ||
public interface WorkspaceMapper { | ||
ProductDTO[] map(Product[] products); | ||
|
||
ProductDTO map(Product product); | ||
|
||
@Mapping(target = "removeMsItem", ignore = true) | ||
@Mapping(target = "removeMfeItem", ignore = true) | ||
@Mapping(target = "productName", source = "name") | ||
@Mapping(target = "ms", source = "microservices") | ||
@Mapping(target = "mfe", source = "microfrontends") | ||
ProductDetailsDTO map(ProductsAbstract productsAbstract); | ||
|
||
List<ProductDetailsDTO> map(List<ProductsAbstract> productsAbstracts); | ||
|
||
default WorkspaceDetailsDTO map(List<String> workspaceRoles, ProductsLoadResult productsLoadResult) { | ||
WorkspaceDetailsDTO workspaceDetailsDTO = new WorkspaceDetailsDTO(); | ||
workspaceDetailsDTO.setWorkspaceRoles(workspaceRoles); | ||
workspaceDetailsDTO.setProducts(map(productsLoadResult.getStream())); | ||
return workspaceDetailsDTO; | ||
} | ||
} |
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